pinterest / riffed

Provides idiomatic Elixir bindings for Apache Thrift
Apache License 2.0
308 stars 37 forks source link

Unstable build runs due to unclean server shutdown #9

Open linearregression opened 8 years ago

linearregression commented 8 years ago

Some logs are showing server startup error out complaining address in use from lingering server process e.g. address \ (EXIT from #PID<0.1690.0>) :eaddrinuse Examples of failed build runs: https://travis-ci.org/pinterest/riffed/builds/100428104 https://travis-ci.org/pinterest/riffed/builds/100394694 https://travis-ci.org/pinterest/riffed/builds/97888684

There are projects that use underlying Erlang library (which is also used in common test in Erlang) to deal with more reliable server shutdown/startup:

There are tests in gen_rpc, that spawned a few Erlang nodes sending messages to each other, for their tests (also on travisci). So there may be something useful there. Those projects are also on travisci so have to deal with travisci build VM performance variance.

linearregression commented 8 years ago

hi Did not have enough time to take closer look. But notice that stop() in https://github.com/lpgauth/thrift-erlang/blob/master/src/thrift_socket_server.erl is doing gen_server:cast to perform stop. terminate closes the gen_tcp. Would that have anything to to do eaddrinuse (previous tcp socket in use has not been closed yet)? how does the library guarantee a clean complete shutdown of :thrift_socket_server