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

Fix Service::stop #1160

Merged
merged 2 commits into from
Nov 13, 2023
Merged

Fix Service::stop #1160

merged 2 commits into from
Nov 13, 2023

Conversation

tinou98
Copy link
Contributor

@tinou98 tinou98 commented Nov 12, 2023

There were 2 issues in the stop system for services :

  • On the first poll of the stream, the shutdown future was not polled, thus stopping the service would never wake this task
  • After the shutdown future is resolved, the next poll will still poll the shutdown future, which is not allowed

@Jarema Jarema self-requested a review November 12, 2023 14:54
@Jarema
Copy link
Member

Jarema commented Nov 12, 2023

Thanks for the PR!
I will take a look shortly.

There were 2 issues in the stop system for services :
- On the first poll of the stream, the shutdown future was not polled,
  thus stopping the service would never wake this task
- After the shutdown future is resolved, the next poll will still poll
  the shutdown future, which is not allowed
Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
Copy link
Member

@Jarema Jarema left a comment

Choose a reason for hiding this comment

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

LGTM!

Thank you for your contribution!
I added a test that does not work with while let Some to test this scenario.

@Jarema Jarema changed the title fix(service): Fix Service::stop not working Fix Service::stop Nov 13, 2023
@Jarema Jarema merged commit 1dbe9c3 into nats-io:main Nov 13, 2023
11 checks passed
@tinou98 tinou98 deleted the stop_service branch November 13, 2023 13:30
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