1.x: improve ExecutorScheduler worker unsubscription some more#3867
1.x: improve ExecutorScheduler worker unsubscription some more#3867zsxwing merged 1 commit intoReactiveX:1.xfrom
Conversation
Tasks are tracked in a separate structure for cancellation, which always happens but maybe not that eagerly and not the same order they were submitted. You should also keep the original up-front |
90f8287 to
bf202ec
Compare
|
Thanks @akarnokd, I've updated the PR and squashed commits. |
|
👍 |
@davidmoten Could you explain how this will happen and why adding |
|
@zsxwing sure, you're right that that is possible but that scenario doesn't worry me in that I just consider that as not being able to stop work in progress as opposed to work that is queued. So I guess that's all that is happening here because the check of |
Sounds like adding |
|
Yep, analagous to that |
|
👍 |
As per discussion in #3842, there was an outstanding possibility that unsubscription of a
Workerwould not cancel all tasks waiting in the queue. This PR addresses that possibility. I attempted to provoke the condition in a unit test but didn't manage it. Nethertheless I think this change completes the protection desired in #3842.I do have mixed feelings about the possible double calling of
queue.clear()(once in therun()method and once in theunsubscribe()method. Any preferences?