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

Remove monkey patching to avoid race conditions #26

Merged
merged 1 commit into from
Sep 21, 2018
Merged

Remove monkey patching to avoid race conditions #26

merged 1 commit into from
Sep 21, 2018

Conversation

FloopCZ
Copy link
Contributor

@FloopCZ FloopCZ commented Sep 19, 2018

Yielding (probably in minio) during http calls and I/O causes some ugly race conditions in is_job_done and maybe some other places.

@FloopCZ FloopCZ requested review from janbuchar and blazekadam and removed request for janbuchar September 19, 2018 10:15
@janbuchar
Copy link
Contributor

Could you elaborate on "ugly race conditions", please? I'm not against removing a part of the monkey patching stuff, but I'm afraid that removing it completely would severely harm the responsiveness of the API.

@FloopCZ
Copy link
Contributor Author

FloopCZ commented Sep 19, 2018

Yes, we can discuss this tomorrow with @blazekadam
as well. For instance, yielding greenlet in between the two checks in this condition can cause UnknownJobError even though the job has just finished processing. But there are probably multiple such issues and I was not able to mark some block as synchronized for gevent.

@janbuchar
Copy link
Contributor

There is a hacky way to do that: call reload(socket) to remove the monkey patches and then monkey.patch() when you're done.

Copy link
Member

@petrbel petrbel left a comment

Choose a reason for hiding this comment

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

Produces #29

@petrbel petrbel merged commit c34f0ae into dev Sep 21, 2018
@petrbel petrbel deleted the no-monkeys branch September 21, 2018 07:28
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.

3 participants