-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Implement mechanism for providing unique ids for json rpc clients #5439
Comments
what is the implementation choice that has been picked up ? between choice 1, 2 and 3 ? |
@benoitf It is not yet decided completely, there appeared some technical impediments so we will probably have something in the middle of the first and the second option. I will provide brief spec draft as soon as the prototype will be tested. |
@dkuleshov thx for the answer, as I noticed that it was in the current-sprint/in-progress I thought it was decided |
Adding brief specification from the PR, there is more info in comment in PR itself What does this PR do?This PR provides a new way of interaction between websocket server-side and client-side. In order to identify a client on server-side to associate with it some processes or data we must have a unique client ID. In previous version client itself was responsible for ID generation and providing to server-side, that approach had its obvious shortcomings. The new approach rearrange responsibilities in a such way that server-side now have a centralized way of generating a unique identifier, while client can get that identifier and use it for its identification further. The JSON-RPC service at the moment has the following api:
request {
"jsonrpc": "2.0",
"method": "websocketIdService/getId",
"id": 0
} response {
"jsonrpc": "2.0",
"result": "529345982734",
"id": 0
}
request {
"jsonrpc": "2.0",
"method": "websocketIdService/setId",
"params": "529345982734"
} So briefly the workflow is the following:
Important commentIn the most basic case when a client establishes a connection server side generates a unique ID which is associated with a session and no client interaction is required at all. However if you need to identify the same client for several websocket sessions (for example when you have several endpoints in a single application) you obviously will need some cross-session identifier and for those purposes we have websocket id service. So answering your question, when client does not call setId it should work just fine within the single websocket session. When client's logic involves several websocket sessions you have to use cross-session ID. |
@dkuleshov @sleshchenko Can we close this issue? |
Now id is a part of endpoint address and generation of it is a responsibility of the client. But there is not a way to guarantee that different clients generate a unique identifier.
There are few ways to be sure that different clients use unique identifier:
Second way looks like easier to implement but there still is no guarantee that clients will use implemented service for generation of identifiers. And the second approach force clients to use an identifier on another hand first approach provides identifiers just like additional functionality for reconnection and clients don't have to use it.
The text was updated successfully, but these errors were encountered: