-
Notifications
You must be signed in to change notification settings - Fork 94
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
[r2r] Fix task::*::cancel
if the RPC task is an awaiting status
#1582
Conversation
Do you think the drop order can affect this? If we reversed |
I haven't checked, but this behaviour is dependent on the executor, and we can't guarantee that the
|
@shamardy I've checked - the order doesn't matter 😁 |
I thought that it won't, I was just curious as I said :)
Agreed, it's better than leaving it in the hands of a race condition. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Just gave it a test in CLI. |
As expected. It's turned out to be difficult to fix, so I created the issue #1586
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
The issue was:
cancel_init_trezor
:https://github.com/KomodoPlatform/atomicDEX-API/blob/6c90c28a29723dad6c48296bed3093686188eeb2/mm2src/mm2_main/src/lp_init/init_hw.rs#L209
RpcTaskManager::cancel_task
:https://github.com/KomodoPlatform/atomicDEX-API/blob/6c90c28a29723dad6c48296bed3093686188eeb2/mm2src/rpc_task/src/manager.rs#L111-L112
RpcTaskManager::tasks
:https://github.com/KomodoPlatform/atomicDEX-API/blob/6c90c28a29723dad6c48296bed3093686188eeb2/mm2src/rpc_task/src/manager.rs#L21-L22
Awaiting
status,abort_handle
ANDaction_sender
are droppedhttps://github.com/KomodoPlatform/atomicDEX-API/blob/6c90c28a29723dad6c48296bed3093686188eeb2/mm2src/rpc_task/src/manager.rs#L269-L274
action_sender
channel is closed beforeabort_handle
, so the task finishes with an error, but we expect that it should abort.