Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check protocol version #250

Merged
merged 1 commit into from
Feb 8, 2024

Conversation

slinkydeveloper
Copy link
Contributor

Fix #235

@slinkydeveloper
Copy link
Contributor Author

In case of protocol version incompatibility, this is the behavior:

  • The runtime ends up in a retry loop, prints
2024-02-08T14:04:48.582810Z WARN restate_invoker_impl
  Error when executing the invocation, retrying in 10s.
    error: [RT0007] [Unknown] unknown. For more details, look at the docs with https://docs.restate.dev/references/errors#RT0007
    restate.error.code: RT0007
    restate.invocation.id: inv_12LP4netCRaH6DrniM3ENA32Wpw4CMplKh
  • The SDK prints the following error message and closes the stream:
[restate] [2024-02-08T14:05:08.594Z] ERROR: Error while handling connection: Error: Unsupported protocol version 1, only version 0 is supported

@StephanEwen
Copy link
Contributor

I think that is fine. Having a proper error on the runtime side would be even nicer, but this is ok for now, SDK side it prints correctly.

@slinkydeveloper slinkydeveloper merged commit a0d271d into restatedev:main Feb 8, 2024
2 checks passed
@slinkydeveloper slinkydeveloper deleted the issues/235 branch February 8, 2024 14:33
@StephanEwen
Copy link
Contributor

To have a proper error on the runtime side as well, we would need to change the following:

  • In the SDK, where we get the request path, we don't immediately respond with 200, 404, etc., but we read the first chunk of bytes, like a header message and interpret that.
  • If that has a protocol mismatch, we send an appropriate status code and error message
  • Otherwise we start setting up the connection to read the actual Restate stream messages

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.

Check the Typescript SDK respects the protocol_version flag
2 participants