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 handling of dead async processor #909

Merged
merged 6 commits into from
Aug 31, 2022
Merged

fix handling of dead async processor #909

merged 6 commits into from
Aug 31, 2022

Conversation

pkasprzyk
Copy link
Contributor

No description provided.

@aniezurawski aniezurawski force-pushed the pk/async-running branch 2 times, most recently from 1e9a8a3 to 1fc4ffc Compare August 24, 2022 08:31
@aniezurawski aniezurawski force-pushed the pk/async-running branch 2 times, most recently from 8b3e0e1 to ee55f88 Compare August 26, 2022 09:22
if not self._consumer.is_running():
exception = NeptuneSynchronizationAlreadyStoppedException()
logger.warning(str(exception))
return
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need to additionally print NeptuneSynchronizationAlreadyStoppedException() here?
We're running flush only from wait, where we already check consumer for running and raise exception if necessary.

Copy link
Contributor

Choose a reason for hiding this comment

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

What does it have to do with flush? It's in _wait_for_queue_empty called on stop().

Copy link
Contributor

Choose a reason for hiding this comment

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

What does it have to do with flush?

Eh, sorry, I've analyzed the code in github...

try:
super().run()
except Exception:
with self._processor._waiting_cond:
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess it's the part responsible for faster dying when sync process is already dead, but I don't know how.
Some commet would be appreciated ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

It just wakes waiting threads when synchronization process is dying. If not for this they would be sleeping forever waiting for synchronization. Nothing magic here.

@aniezurawski aniezurawski merged commit 3735fdc into master Aug 31, 2022
@aniezurawski aniezurawski deleted the pk/async-running branch August 31, 2022 07:58
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.

5 participants