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

Heartbeat no longer shares the app's Context #1262

Merged
merged 3 commits into from Jan 14, 2012
Merged

Conversation

minrk
Copy link
Member

@minrk minrk commented Jan 13, 2012

This is the chosen solution 2. in #1260. I couldn't see any of the extra bookkeeping that I thought might be necessary, so simply creating a new context is all there was to do.

Test script and notebook added to examples directory for easier confirmation, as described in #1127

closes #1260

This prevents the heartbeat from ever waiting for the GIL, which
could cause erroneous heartbeat failures.
@ellisonbg
Copy link
Member

This fixes looks quite simple and it looks ready for merging. Thanks again for tracking this down!

@minrk
Copy link
Member Author

minrk commented Jan 14, 2012

I just realized that this obviously can also affect the parallel engines, so I'll make the same change there before merging.

@minrk
Copy link
Member Author

minrk commented Jan 14, 2012

Similar tiny change in parallel, merging shortly.

minrk added a commit that referenced this pull request Jan 14, 2012
Heartbeat no longer shares the app's Context

Fixes in both the single and parallel kernels, preventing the heartbeat thread from sharing the zmq Context with the rest of the process.  Non-copying sends require grabbing the GIL from the zmq io-thread in order to free memory, which could let Python get in the way of the heartbeat.

Test script and notebook added to examples directory.

closes #1260
@minrk minrk merged commit 1c4daed into ipython:master Jan 14, 2012
minrk added a commit that referenced this pull request Jan 18, 2012
Heartbeat no longer shares the app's Context

Fixes in both the single and parallel kernels, preventing the heartbeat thread from sharing the zmq Context with the rest of the process.  Non-copying sends require grabbing the GIL from the zmq io-thread in order to free memory, which could let Python get in the way of the heartbeat.

Test script and notebook added to examples directory.

closes #1260
mattvonrocketstein pushed a commit to mattvonrocketstein/ipython that referenced this pull request Nov 3, 2014
Heartbeat no longer shares the app's Context

Fixes in both the single and parallel kernels, preventing the heartbeat thread from sharing the zmq Context with the rest of the process.  Non-copying sends require grabbing the GIL from the zmq io-thread in order to free memory, which could let Python get in the way of the heartbeat.

Test script and notebook added to examples directory.

closes ipython#1260
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.

heartbeat failure on long gil-holding operation
2 participants