[erlang-questions] OTP 22.1 socket.erl somehow breaks message delivery or scheduler

Andreas Schultz andreas.schultz@REDACTED
Mon Oct 28 16:39:13 CET 2019


Am Mo., 28. Okt. 2019 um 15:22 Uhr schrieb Björn Gustavsson <
bjorn@REDACTED>:

> Thanks for reporting this issue.
>
> We have investigated the issue and found that it is a bug in the compiler.
>

wow. I have to say I'm a bit scared of OTP 22.x at the moment because of
all the "bugs in the compiler" changes lately.
Did the rewrite of the compiler in 22.0 cause all this or was it present
before and just went unnoticed?

Anyway, many thanks for finding this,
Andreas


> https://bugs.erlang.org/browse/ERL-1076
>
> https://github.com/erlang/otp/pull/2434
>
> /Björn
>
> On Wed, Oct 23, 2019 at 3:53 PM Andreas Schultz
> <andreas.schultz@REDACTED> wrote:
> >
> > Hi,
> >
> > After converting an application to socket.erl in OTP 22.1, the test
> suites started to fail with random timeouts. It took me a while to figure
> out that gen_server:calls arrived multiple seconds late in the server.
> >
> > I have a demonstration at
> https://gist.github.com/RoadRunnr/311a7679fff6fbdf367c455b960f1ba8. It
> implements a simple UDP echo server with socket.erl. The client uses
> gen_udp to send messages and wait for the response.
> > The client also sends Erlang ping message to the server and expects to
> get a pong answer back. The socket.erl based server is supposed to not
> block (and as far as I can tell, it does not), it therefore should be able
> to answer the Erlang ping message all the time.
> > There are also some simple busy loop process running to get some load.
> Without them the problem is not reproducible.
> >
> > The sample is failing in about 20% off the test runs, when it does the
> output is something like:
> >
> > $ ~/stest.escript
> > Server Pid <0.78.0>
> > Server Addr #{addr => {127,0,0,1},family => inet,port => 38959}
> > ping timeout
> >            round trip    Clnt/Srvr    Srvr/Clnt     ProcPing
> > ...
> >       85: ******** ns, ******** ns,    57675 ns,    42332 ns
> > ...
> >
> > The failure happens because a 'ping' message is not see in time by the
> receive clause in the server process. It seems that either the process is
> not scheduled for some time (multiple seconds), or the scanning of the
> mailbox is missing the message.
> >
> > I have ruled out that the UDP messages are being dropped, otherwise the
> clients gen_udp:recv would never return.
> >
> > Does anyone have a clue what might cause this? Or point out where my
> sample is broken.
> >
> > Many thanks
> > Andreas
> >
> > --
> >
> > Andreas Schultz
> >
> >
> >
> > _______________________________________________
> > erlang-questions mailing list
> > erlang-questions@REDACTED
> > http://erlang.org/mailman/listinfo/erlang-questions
>
>
>
> --
> Björn Gustavsson, Erlang/OTP, Ericsson AB
>


-- 

Andreas Schultz

-- 

Principal Engineer

t: +49 391 819099-224

------------------------------- enabling your networks
-----------------------------

Travelping GmbH

Roentgenstraße 13

39108 Magdeburg

Germany

t: +49 391 819099-0

f: +49 391 819099-299

e: info@REDACTED

w: https://www.travelping.com/

Company registration: Amtsgericht Stendal  Reg. No.: HRB 10578
Geschaeftsfuehrer: Holger Winkelmann VAT ID: DE236673780
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20191028/70942d79/attachment.htm>


More information about the erlang-questions mailing list