[erlang-questions] R17 - Possible wedged scheduler

Matthew Evans <>
Fri Dec 9 19:31:36 CET 2016

Thanks, I'll give that a go,

Looking at code_server.erl  it does appear that there exists a possibility of a deadlock. In so much as function cpc_recv/4 does a receive with no timeout.

Thanks again


From: Michael Truog <>
Sent: Friday, December 9, 2016 1:03 PM
To: Matthew Evans; Erlang/OTP discussions
Subject: Re: [erlang-questions] R17 - Possible wedged scheduler

If this is scheduler collapse, it would mean you have a port driver or NIF that has internal latency greater than 1 millisecond.  To handle scheduler collapse, you can use the erl command line option "-heart" combined with:

(see http://erlang.org/doc/man/heart.html#set_options-1 )

That will allow the system to restart when schedulers have collapsed.

A test that is meant to cause scheduler collapse is at:

GitHub - basho/nifwait: Utility to test effect of blocking ...<https://github.com/basho/nifwait>
README.md Utility to test effect of blocking NIF on Erlang scheduler. Test spawns several processes, all which will start in the run queue of the current scheduler.

So you could use that to prove to yourself that the behavior is the same with the system you are having problems with.

On 12/09/2016 08:35 AM, Matthew Evans wrote:

Happened again, it appears that code_server is wedged:

:~$ doErlangFun "erlang:process_info(whereis(code_server))."

















































From: <mailto:> <><mailto:> on behalf of Matthew Evans <><mailto:>
Sent: Friday, December 9, 2016 9:56 AM
To: Erlang/OTP discussions
Subject: [erlang-questions] R17 - Possible wedged scheduler


We just hit a situation where it appeared that 1 scheduler was wedged. Some parts of our application were working, but others appeared to be stuck. I could connect via a cnode application and an escript, but I couldn't connect via the Erlang shell. We have an escript that does rpc calls, some worked, others (e.g. anything to the code server or tracing failed) failed.

CPU load was minimal at the time, and heart didn't complain. We only have a single NIF, but this is not called on this hardware variant. We do use CNODE to talk to C applications.

We are running R17, Intel quad core CPU on Debian.

This is the first time this has been seen, so the questions are:

1. Has anyone seen this before?

2. What can we do if we hit this condition in the future to debug?

3. Since heart doesn't detect this can anyone think of any alternative mechanisms?



erlang-questions mailing list

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20161209/ead729e9/attachment-0001.html>

More information about the erlang-questions mailing list