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

Avoid deadlock on IDENTITIES_TASKS_ON #65

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

trbs
Copy link
Contributor

@trbs trbs commented Jan 16, 2018

Add try-finally to make sure IDENTITIES_TASKS_ON is switched back to False when exception happens during execution.

The use of IDENTITIES_TASKS_ON might cause Mordred to wait forever when an exception occurs inside task_identities.

One example of such exception is when the MySQL server connection goes away temporarily.

Moving it into a try-finally block should avoid this.

…False when exception happens during execution
@acs
Copy link
Member

acs commented Jan 17, 2018

I have thought the same during the implementation and probably, we need to follow your PR suggestion. I hate to include all implementation code for a method inside a try block, because indentation and because it points to something that probably should be redesigned. But in this case, probably it is the best approach with the current design. Let me think about it a bit more and I will provide you a final decision.

Thank you very much for this contribution. I hope you to be on the community for some time. It seems you start to know mordred pretty well. How are you learning how the platform works? Reading the code? Reading the GrimoireLab guide?

@trbs
Copy link
Contributor Author

trbs commented Jan 17, 2018

@acs agree it does not win any beauty contests :-)

Alternative could be to move this as a new "feature" of Task class. Having some kind of setup() and teardown() methods on Task or alikes. But that would mostly push down the same implementation detail while no other tasks would use it. So arguably that would be only hiding it.

Otherwise probably need a more fundamentally different way of doing this type of syncing of the tasks ?

As for learning; the GrimoireLab guide was helpful understanding the broader architecture but mostly by reading the code.

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