Skip to content

Conversation

@keroro520
Copy link
Contributor

cancel_task should remove the target task from running and pending queue.

}

pub async fn cancel_task(&mut self, key: ProofTaskDescriptor) -> HostResult<()> {
// Remove cancelling task from pending tasks
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need here because cancel eventually make a signal to task process and break the loop there, so the pending will be cleared by complete signal there (correct me if I forget sth), anyway, this cancel is kind of tricky and better to refactory later on.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree that cancel needs some more re-design and test coverage.

@keroro520
Copy link
Contributor Author

I'm not sure whether we should do clean pending tasks or not when cancel_task involves. But as we may refactor the cancel_task, it's fine to close this PR.

@keroro520 keroro520 closed this Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants