This repository has been archived by the owner on May 25, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make httpc connection closing asynchronous (#47)
httpc pool's terminate/2 can block up to 5 seconds in case when ssl sockets are used. Previously this was not an issue as replication jobs would run until completion and only exit once. With the scheduler, replication jobs are stopped regularly during rescheduling. So terminate/2 could be called `max_churn` number of times in a row during each reschedule cycle. This could lead to scheduler gen_server being blocked for up to 100 seconds at a time. To fix, unlink the connection and call stop in a separate process. This way, socket will get a chance to be closed properly, but if it doesn't, ibrowse client will kill it (this ensures connection processes won't leak).
- Loading branch information