<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">---------- Forwarded message ---------<br>From: <b class="gmail_sendername" dir="auto">Rickard Green</b> <span dir="auto"><<a href="mailto:rickard@erlang.org">rickard@erlang.org</a>></span><br>Date: Thu, Apr 16, 2020 at 3:28 PM<br>Subject: Re: possible process_info(Pid, message_queue_len) degradation<br>To: Max Lapshin <<a href="mailto:max.lapshin@gmail.com">max.lapshin@gmail.com</a>><br></div><br><br><div dir="ltr"><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Apr 15, 2020 at 11:16 PM Max Lapshin <<a href="mailto:max.lapshin@gmail.com" target="_blank">max.lapshin@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi.<br>
<br>
We have a piece of code that does (a bad) thing:<br>
<br>
case process_info(whereis(?MODULE), message_queue_len) of<br>
{_, Len} when Len > 150 -><br>
{error, overloaded};<br>
<br>
<br>
On 22.1.4 it was working without any visible problems.<br>
<br>
On 22.3 we are getting problems. Process that does it is hanging in:<br>
<br>
pulsedb_appender:28 delay in writing to wal:<br>
<br>
[{erts_internal,await_result,1,[{file,"erts_internal.erl"},{line,122}]},<br>
{pulsedb_wal_writer,write,1,[{file,"pulsedb_wal_writer.erl"},{line,14}]},<br>
<br>
<br>
Timeout of 3000 milliseconds that was not hit before, now is expired<br>
very often and we see that the calling process is in this new<br>
function.<br>
<br>
<br>
Question is: could checking process_info message_queue_len become<br>
more expensive in 22.1.3 -> 22.3 update?<br>
</blockquote></div><br clear="all"><div dir="ltr"><div><div>You probably hit this bug which was fixed in OTP 22.3.1:<br><br> OTP-16572 Application(s): erts<br> Related Id(s): ERL-1199, OTP-16269<br><br> Fixed a bug in a receive optimization. This could cause<br> a receive not to match even though a matching message<br> was present in the message queue. This bug was<br> introduced in ERTS version 10.6 (OTP 22.2).<br><br></div>Regards,<br></div>Rickard<br></div>-- <br><div dir="ltr">Rickard Green, Erlang/OTP, Ericsson AB</div></div></div>
</div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">Rickard Green, Erlang/OTP, Ericsson AB</div></div>