Skip to content
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

Send end progress when request is cancelled. #1366

Merged
merged 2 commits into from
Aug 23, 2022

Conversation

ztion
Copy link
Contributor

@ztion ztion commented Aug 21, 2022

Description

If task is long running, the background job gen_server will not process messages meanwhile. So when stopping background job, it seems supervisor will timeout and kill the process instead of graceful shutdown. So terminate function is not called.
This PR changes to run the task in a subprocess.

Also send an error response for cancelled tasks. As I understand it, even cancelled requests must send a response.

Fixes #1365 .

@robertoaloi
Copy link
Member

@ztion It makes sense to me, thanks for catching this and for providing a fix!

@robertoaloi robertoaloi merged commit 6ec9407 into erlang-ls:main Aug 23, 2022
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.

No end progress sent when request is cancelled
2 participants