You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by "Nick Vatamaniuc (JIRA)" <ji...@apache.org> on 2016/03/04 05:35:40 UTC

[jira] [Created] (COUCHDB-2959) Deadlock condition in replicator with remote source and configured 1 http connection

Nick Vatamaniuc created COUCHDB-2959:
----------------------------------------

             Summary: Deadlock condition in replicator with remote source and configured 1 http connection
                 Key: COUCHDB-2959
                 URL: https://issues.apache.org/jira/browse/COUCHDB-2959
             Project: CouchDB
          Issue Type: Bug
          Components: Replication
            Reporter: Nick Vatamaniuc


A deadlock that occurs that can get the starting replications to get stuck (and never update their state to triggered). This happens with a remote source and when using a single http connection and single worker.

 The deadlock occurs in this case:

 - Replication process starts, it starts the changes reader: https://github.com/apache/couchdb-couch-replicator/blob/master/src/couch_replicator.erl#L276

 - Changes reader consumes the worker from httpc pool. At some point it will make a call back to the replication process to report how much work it has done using gen_server call {{report_seq_done}}

 - In the meantime, main replication process calls {{get_pending_changes}} to get changes from the source. If the source is remote it will attempt to consumer a worker from httpc pool. However the worker is used by the change feed process. So get_pending_changes is blocked waiting for a worker to be released.

 - So changes feed is waiting for report_seq_done call to replication process to return while holding a worker and main replication process is waiting for httpc pool to release the worker and it never responds to report_seq_done.



 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)