You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that there might be a (low probability) race condition in your example in the interaction between handle_info/3 and the worker/3 function. If the commands execute in the order indicated by the numbers below, the wrong process owns the socket after sending the response data.
I think that there might be a (low probability) race condition in your example in the interaction between handle_info/3 and the worker/3 function. If the commands execute in the order indicated by the numbers below, the wrong process owns the socket after sending the response data.
handle_info({tcp, Sock, Data}, State) ->
worker(Owner, Sock, Data) ->
3 . gen_tcp:send(Sock, Data),
4 . inet:setopts(Sock, [{active, once}]),
5. gen_tcp:controlling_process(Sock, Owner).
I simulated the issue by inserting a timer:sleep(1000) between instructions 2 and 6.
The text was updated successfully, but these errors were encountered: