Add configurable response expiration time to Server #1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hey!
I noticed that in our application, when under load, the server sometimes sends and expires the response for a request faster than the client can look up the response.
These are the calls in a working situation:
The first two calls are the client pushing a request and immediately block-popping the response, effectively monitoring the list for the response of the server.
But sometimes this situation shows up:
So the client first pushes the request, then the server immediately pushes and expires the response before the client calls the "blpop" command on the message queue. At the point where the client calls the "blpop" command, the response is already expired.
The proposed changes offer a configurable expiration duration for the server responses, giving the client more time to get the response back from redis.