qtconsole heartbeat sensor during calls of compiled extensions?
I have built a python extension that wraps a C library. When I call a function from this library from the qtconsole, which doesn't return within 3 seconds, this triggers the heartbeat sensor:
"The kernel heartbeat has been inactive for 3.00 seconds. Do you want to restart the kernel? You may first want to check the network connection."
I found this feature useful before when my code really crashed, but here everything is fine, since I know that the library call will take some time. The command continues to execute in the qtconsole and returns properly (behind the warning window). So a workaround consists of waiting until the function returns and then clicking the heartbeat message away with "No".
However, I was wondering if there was a mechanism to tell the heartbeat sensor: "This is a call to a compiled extension which may take some time, and that's expected". Or is there a way to modify the time span, or switch it off altogether?
I have built a python extension that wraps a C library. When I call a
function from this library from the qtconsole, which doesn't return within 3
seconds, this triggers the heartbeat sensor:
What version of IPython are you using? I have a feeling this was fixed recently - the heartbeat responder should now run in a separate ZMQ context, so it doesn't get blocked by long-running library calls.