Skip to content

Conversation

@andreachild
Copy link
Contributor

Replaced web sockets with http for Golang driver and removed a lot of code that is no longer applicable for Tinkerpop 4.0. Note that tests are not yet enabled as they will not pass without changes to serialization.

The following was changed as part of conversion from web sockets to http:

  • gorilla ws library replaced with native http library
  • removed docker dependency on gremlin-socket-server
  • connection and connection pooling changed to delegate to native http library
  • protocol and transport interfaces replaced with single concrete http implementations

The following was removed as no longer applicable for Tinkerpop 4.0:

  • sessions
  • request id
  • request processor
  • request op
  • response attributes
  • response meta data

Out of scope for future PRs:

  • response chunk streaming (entire response is processed at once)
  • interceptors (ie. authentication)
  • full http connection configuration
  • serialization/deserialization changes

@codecov-commenter
Copy link

codecov-commenter commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.99%. Comparing base (cfd6889) to head (452c2c8).
Report is 142 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3059      +/-   ##
============================================
+ Coverage     77.87%   77.99%   +0.11%     
- Complexity    13578    13908     +330     
============================================
  Files          1015     1019       +4     
  Lines         59308    59933     +625     
  Branches       6835     6950     +115     
============================================
+ Hits          46184    46742     +558     
- Misses        10817    10858      +41     
- Partials       2307     2333      +26     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

if transporter.connSettings.enableUserAgentOnConnect {
req.Header.Set(userAgentHeader, userAgent)
}
if transporter.connSettings.enableCompression {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enableCompression existed in 3.7 to manage per message deflate in WebSockets, but was removed in master. Maybe this is a setting that also applies to master but I feel like in the vast majority of cases this should just be left on.


// receives a binary response message, deserializes, and adds results to the ResultSet
func (protocol *httpProtocol) receive(rs ResultSet, msg []byte) error {
resp, err := protocol.serializer.deserializeMessage(msg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not all messages return as GraphBinary. It's possible for some errors to still be "application/json". The driver needs to decide what to do by reading the content-type header.

@Cole-Greer
Copy link
Contributor

VOTE +1


func (transporter *httpTransporter) createResponseError(respBytes []byte, resp *http.Response) error {
contentType := resp.Header.Get(contentTypeHeader)
if contentType == "application/json" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very small nit: are there no constants for commonly used HTTP values?

@kenhuuu
Copy link
Contributor

kenhuuu commented Mar 14, 2025

VOTE +1

1 similar comment
@xiazcy
Copy link
Contributor

xiazcy commented Mar 17, 2025

VOTE +1

@xiazcy xiazcy merged commit b2b592c into apache:master Mar 17, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants