cmullaparthi / ibrowse

Erlang HTTP client
Other
515 stars 191 forks source link

Introduce an option to not trap process exits in worker processes #171

Closed nickva closed 3 years ago

nickva commented 3 years ago

When worker processes are part of an external connection pool it may make sense to rely on automatic cleanup based on links. Since by default worker processes trap exits, linked proceses would fail to terminate the ibrowse worker and instead it would generate an {'EXIT', Pid, Reason} which is handled in handle_info/2 with a warning to stdout.

Add a new option to allow users to control worker process link behavior via an ibrowse config parameter. The default stays the same (=true).

nickva commented 3 years ago

This PR is related a bit to issue https://github.com/cmullaparthi/ibrowse/issues/146. We had attempted to upgrade CouchDB's replicator ibrowse version and noticed a bunch of {'EXIT', Pid, normal} messages in the console followed by timeouts and test failures. The reason was that since 4.0 (our version of ibrowse) worker processes trap exits and we relied on owner which "checks out" workers from the pool linking to the worker and then performing automatic cleanup if the owner dies.

cmullaparthi commented 3 years ago

Thanks for the patch Nick!

rnewson commented 3 years ago

nice.