[
https://issues.apache.org/jira/browse/COUCHDB-3082?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15394403#comment-15394403
]
ASF GitHub Bot commented on COUCHDB-3082:
-----------------------------------------
GitHub user nickva opened a pull request:
https://github.com/apache/couchdb-couch-replicator/pull/43
Replication manager's rep_start_pids now contains only {Tag, Pid} items
Previously the local change feed was added to rep_start_pids as Pid only.
So if
replication manager stopped and terminate/2 was called before that change
feed died, then
```
foreach(fun({_Tag, Pid}) -> ... end, [StartPids])
```
would crash with a function clause error.
Jira: COUCHDB-3082
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/couchdb-couch-replicator
3082-replication-manager-rep_start_pids-fix
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/couchdb-couch-replicator/pull/43.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #43
----
commit 17cb967243b9b7111a331fea796976c53718dd7d
Author: Nick Vatamaniuc <[email protected]>
Date: 2016-07-26T19:22:52Z
Replication manager's rep_start_pids now contains only {Tag, Pid} items
Previously the local change feed was added to rep_start_pids as Pid only.
So if
replication manager stopped and terminate/2 was called before that change
feed died, then
```
foreach(fun({_Tag, Pid}) -> ... end, [StartPids])
```
would crash with a function clause error.
Jira: COUCHDB-3082
----
> Replicator manager crashes in terminate/2 if initial change feed spawned for
> _replicate hasn't finished
> -------------------------------------------------------------------------------------------------------
>
> Key: COUCHDB-3082
> URL: https://issues.apache.org/jira/browse/COUCHDB-3082
> Project: CouchDB
> Issue Type: Bug
> Reporter: Nick Vatamaniuc
>
> During init we spawn a change feed for the _replicator db and assign
> rep_start_pids = [Pid]. However the shape of rep_start_pids should be {Tag,
> Pid}. In terminate/2 we clean up by doing:
> {code}
> lists:foreach(
> fun({_Tag, Pid}) ->
> ...
> [{scanner, ScanPid} | StartPids]),
> {code}
>
> Which ends up crashing with a function clause because we expect foreach
> function to get a tuple of 2 items.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)