<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Thank you for the response.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Obviously, active once should resolve my problem, and I will modify the code accordingly.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">In the meantime, I have resolved the issue by raising ssl:recv timeout to 15 seconds. In my environment this essentially means that timeout does not occur.</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I'd like to stress that in almost 2 years of production, I have never experienced this issue with R14.</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">It is also very strange that I was always loosing first byte of the message and not more. Which still leads me to believe that some bug might have been introduced regarding passive sockets.</div>
<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
However, active once seems like a cleaner solution, and I will therefore go ahead with that approach.</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br>
</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Best regards,</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
Sasa</div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></div><br><div class="gmail_quote">On Mon, Nov 5, 2012 at 11:08 AM, Ingela Andin <span dir="ltr"><<a href="mailto:ingela.andin@gmail.com" target="_blank">ingela.andin@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi!<br>
<br>
The only thing that might have changed between R14 and R15 is the<br>
timing so that this happens to you more often, but using a timeout to<br>
recv can cause<br>
you to sort of loose data as you will not stop the recv of being<br>
processed by ssl, only cause recv to return early. This is much like<br>
if you time out a POST request to a webserver the request may still<br>
have reached the webserver and have been executed on the server side.<br>
I think that if you do not want to hang<br>
in recv you should use active once instead passive receive (recv).<br>
<br>
Regards Ingela Erlang/OTP team - Ericsson AB<br>
<br>
<br>
2012/11/2 sasa <<a href="mailto:sasa555@gmail.com">sasa555@gmail.com</a>>:<br>
<div class="HOEnZb"><div class="h5">> Hello,<br>
><br>
> Today I have migrated my production servers to R15B02 (previously they ran<br>
> on R14).<br>
> Generally, everything works fine. However, I do notice a strange behavior<br>
> occasionally.<br>
> I'm not sure if Erlang is to blame, but it's a strange coincidence that this<br>
> started occurring after the migration, and system is in production for<br>
> almost two years.<br>
><br>
> In my system, I am constantly fetching some data from the external provider<br>
> via ssl. The code is roughly following:<br>
><br>
> loop(Socket) -><br>
> ssl:recv(Socket, 0, 5000),<br>
> ...<br>
> loop(Socket).<br>
><br>
> After switching to R15, I have noticed that occasionally, a byte gets<br>
> "lost". This always happens after 5 or 10 seconds which leads me to<br>
> suspicion, that possibly some race condition occurs in ssl.<br>
> Could it be that the timeout occurs just as the bytes start to arrive, and<br>
> the first one is discarded?<br>
> Again, I didn't notice this behavior on R14.<br>
><br>
> Best regards,<br>
> Sasa<br>
><br>
</div></div><div class="HOEnZb"><div class="h5">> _______________________________________________<br>
> erlang-questions mailing list<br>
> <a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
> <a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
><br>
</div></div></blockquote></div><br>