-
Notifications
You must be signed in to change notification settings - Fork 176
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
Refresh session when within the last 10% of ticket params validity period #1852
Comments
Are there cases of this actually happening ? Because currently the orchestrator would send updated ticket params with a new expiry based on its last seen block with every segment. The expiration is currently set at 5 blocks so for this to occur the segment in flight would have to be longer than 5 ethereum blocks or 1 minute or the orchestrator has a stale view of the last seen block (in which case refreshing doesn't help) or a combination of both. |
Hard to say for certain, but I have observed a number of TicketParams expired errors being returned by various Os on the network at a regular frequency. So, in each of those cases, the O that returns the TicketParams expired would be temporarily suspended from selection by the O causing unnecessary churn in B's session list for a stream.
If a B receives TicketParams from a set of Os and then switches to one of the Os within the 5 block validity period for the TicketParams then there is a greater chance that the TicketParams expire while a segment is in flight. It is possible that a solution for this issue would not completely address these TicketParams expired errors, but I believe that it would at least help avoid possible edge cases where TicketParams expire while a segment is in flight. If we implement this and still observe those errors consistently, we can look into additional solutions (for example, increasing the TicketParams validity period to relax the block synchronization requirements b/w B & O). |
It seems that there could actually be to distinguishable issues here then and the solution for each might be different.
|
Agreed on the following points:
With all that said, I think the extension of the TicketParams validity period can be considered in a separate issue especially since this would be a change on O. The OP describes a change on B. Specifically, the OP describes a way for B to avoid the edge case where it believes the TicketParams are expired and then the TicketParams expire while a segment is in flight. Even if the TicketParams validity period is extended, this edge case is possible. We send a refresh request for an auth token when it is within 10% of the end of its validity period for a similar reason. |
We only refresh the auth token for the session that is being actively used. We already refresh ticket params for the actively used session on a per segment basis. This behaviour is already similar , and even better, the ticketparams are refreshed more often (each segment) rather than 10% before expiry of a timer. Since we do not actively refresh auth tokens for sessions that are not transcoding I don't deem a change necessary on the B side here. In addition more concretely, since the expiration is currently at 5 blocks and 10% would be less than a block we would essentially be refreshing every 3 blocks on top of receiving new ticket params with each segment. I think this is too often so I would first do a longer expiry period and see if the edge case still occurs with what is considered normal length segments. |
We would also only be sending a refresh request for the current session that is being used if the associated TicketParams are close to expiring similar to what we do for auth tokens.
See above.
Sure. Can you open an issue for that? I think tackling that first is reasonable given your point on how short the TicketParams validity period is right now. |
Not sure if #1877 is along the lines of what you had in mind. |
Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
At the moment, B will refresh a session (i.e. call GetOrchestrator on O to get a fresh OrchestratorInfo message) if the O's ticket params are expired. However, ticket params can expire while a segment is in flight to O. If this happens, the O will return a TicketParams expired error when the segment is received and B will temporarily suspend O for returning an error.
Describe the solution you'd like
A clear and concise description of what you want to happen.
B should refresh a session if O's ticket params are almost expired. B refreshes a session if O's auth token is within 10% of the end of its validity period. We can do something similar with ticket params where B refreshes a session if O's ticket params are within 10% of the end of its validity period.
The text was updated successfully, but these errors were encountered: