Skip to content

bug: Gorums does not forward context #219

@meling

Description

@meling

Gorums fails to forward context to the server-side, and thus is not able to cancel or pass values from the client to the server via context.

We discussed this issue a while back when @aleksander-vedvik was working on the multiparty implementation, and there seems to be some customized support for cancelation in that code. But looking at the code it does not appear to work via the context.CancelFunc. Moreover, it does not pass the context.Value entries.

We need to add support for passing context. We can use the metadata package from the gRPC library. Here are some resources:

Tasks:

  • Set up test cases to showcase the problem.
  • Review the docs above.
  • Investigate what gRPC does in their runtime.
  • Implement solution.

Looking at the examples, we might actually have to use the metadata package explicitly. I'm not sure, but I have always assumed that we can use the context.Context we pass to the client call to cancel the request, or pass a value via its context from the client to the server-side. Need to check this with gRPC. Looking at the Examples listed above it looks less clear that that is the approach.

But since we already use the ordering.Metadata message to pass our own Gorums metadata, we should be able to pass the content of metadata.MD as part of our own Metadata message, and repopulate the context.Context values before we pass it to the server-side implementation via ServerCtx.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions