Skip to content

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 <[email protected]>
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
@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