-
Notifications
You must be signed in to change notification settings - Fork 354
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
[QUESTION] Abandon a pipeline after exec has been invoked #585
Comments
Operations on In your case, e.g. calling Regards |
Calling discard caused access violation while writing to the connection in the next iteration |
I think this is caused by race condition, and as I mentioned, you need to use mutex to protect it.
No, I don't think this is the right solution. Regards |
what is here to protect? the exec is executed within the task almost immediately |
How can you ensure that all operations on pipeline in the async thread finish in 500ms?
If the Also, if You can try the following code to test if it's working:
Regards |
I know they finish and that is not the issue here even thought I get your point. All set and execute operations are done long before 500ms
So that's the question, how can I abandon the pipeline? discard should create new connection and return that to the pool, so in the next iteration when I call pipeline on redis instance, I should get the new connection from the pool. The problem with your code sample is, that it is blocked until the exec is finished because of the mutex and that's exactly what I'm trying to avoid. I wanna abandon the connection the moment wait_for timeouts and I don't care about the results anymore because the next iteration overwrites it all. |
Yes, that's the current behavior.
If you don't block until
Yes, the previous connection has been destroyed, and that's why I reset the If you don't want to wait for 500ms, you can set Regards |
Describe the problem
I have the code which is called in a loop and I need to use the connection pool every iteration. If the single iteration does not finish within the specified time span I need to abandon the results and I'm not sure how to do that.
pipeline destructor returns the connection to the pool, but in the next iteration I get an error with access violation. I cannot use discard as it also results in access violation.
Is there a safe way how to abandon the in-progress commands on connections from the connection pool?
Environment:
The text was updated successfully, but these errors were encountered: