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

Adding client ID to identify clients (and retrieve specific context)? #418

Open
stevefan1999-personal opened this issue Jan 15, 2024 · 2 comments

Comments

@stevefan1999-personal
Copy link

stevefan1999-personal commented Jan 15, 2024

Although I can workaround it by generating a random UUID and both server and client agree to use that as a universal identifier, are there any better way to do this in tarpc without having to manually resolve the data context (not tracing context) all the time?

Right now, I use this to solve the client retry issue because the client can disconnect intermittently. Once the "key agreement" is established, I can replay the client messages logically so that we can resume on working. However, this also means the RPC methods must not have any side effect (i.e. idempotent)

@tikue
Copy link
Collaborator

tikue commented Feb 2, 2024

Hi! Sorry, I missed this earlier. Thanks for filing.

Generally, I would envision the client being identified by a load balancing layer, part of the transport (which tarpc doesn't bake in). That would kind of go hand-in-hand with client reconnect behavior.

@stevefan1999-personal
Copy link
Author

Hi! Sorry, I missed this earlier. Thanks for filing.

Generally, I would envision the client being identified by a load balancing layer, part of the transport (which tarpc doesn't bake in). That would kind of go hand-in-hand with client reconnect behavior.

Yeah, I just realized what I expressed about the "universal identifier" is just some kind of stateless construct, such as a cookie or a bearer token. To think further, we will need to do session management in tarpc.

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

No branches or pull requests

2 participants