[erlang-patches] SCTP Peeloff socket can block erlang VM if set to {active, true}

Jonas Falkevik jonas.falkevik@REDACTED
Fri Jul 20 00:46:55 CEST 2012


When using SCTP sockets and peeloff there is a problem if trying to set the socket to {active,true}.

The new socket returned by the sctp_peeloff call is not set to non-blocking, which the reused packet_inet_input() is relying on.
There is a default packet poll for 5 packet and if there are less then five packets, the receive will block the thread unless the socket is non-blocking.

git fetch git@REDACTED:falkevik/otp.git fix_sctp_peeloff_active_true

https://github.com/falkevik/otp/compare/falkevik:master...falkevik:fix_sctp_peeloff_active_true
https://github.com/falkevik/otp/compare/falkevik:master...falkevik:fix_sctp_peeloff_active_true.patch
https://github.com/falkevik/otp/commit/7adbaf8b29f1411c4b83a5911869adabc5e6038b.patch


Test case added so that both {active, true} and {active, once} are tested after sctp_peeloff().

git fetch git@REDACTED:falkevik/otp.git sctp_peeloff_active_true_test

https://github.com/falkevik/otp/compare/falkevik:master...falkevik:sctp_peeloff_active_true_test
https://github.com/falkevik/otp/compare/falkevik:master...falkevik:sctp_peeloff_active_true_test.patch
https://github.com/falkevik/otp/commit/044604a655db0d3329e589638d40f8fb075b6057.patch


Jonas


More information about the erlang-patches mailing list