[erlang-questions] R1502 ssl dropping byte(s)?
Mon Nov 5 11:08:41 CET 2012
The only thing that might have changed between R14 and R15 is the
timing so that this happens to you more often, but using a timeout to
recv can cause
you to sort of loose data as you will not stop the recv of being
processed by ssl, only cause recv to return early. This is much like
if you time out a POST request to a webserver the request may still
have reached the webserver and have been executed on the server side.
I think that if you do not want to hang
in recv you should use active once instead passive receive (recv).
Regards Ingela Erlang/OTP team - Ericsson AB
2012/11/2 sasa <sasa555@REDACTED>:
> Today I have migrated my production servers to R15B02 (previously they ran
> on R14).
> Generally, everything works fine. However, I do notice a strange behavior
> I'm not sure if Erlang is to blame, but it's a strange coincidence that this
> started occurring after the migration, and system is in production for
> almost two years.
> In my system, I am constantly fetching some data from the external provider
> via ssl. The code is roughly following:
> loop(Socket) ->
> ssl:recv(Socket, 0, 5000),
> After switching to R15, I have noticed that occasionally, a byte gets
> "lost". This always happens after 5 or 10 seconds which leads me to
> suspicion, that possibly some race condition occurs in ssl.
> Could it be that the timeout occurs just as the bytes start to arrive, and
> the first one is discarded?
> Again, I didn't notice this behavior on R14.
> Best regards,
> erlang-questions mailing list
More information about the erlang-questions