Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

couch_replicator_scheduler killing "completed normally" replication? #644

Closed
wohali opened this issue Jul 5, 2017 · 2 comments
Closed
Assignees

Comments

@wohali
Copy link
Member

wohali commented Jul 5, 2017

Current & Expected Behavior

Normally the couch_replicator_use_checkpoints_tests pass fine. However, we have an unusual failure in a Travis run today. The replication scheduler says it "completed normally", but then it appears it proceeds to KILL it?! Odd.

Logs

Assigning to @nickva because this feels like a scheduler bug.

@nickva
Copy link
Contributor

nickva commented Jul 11, 2017

Sprinkled some ?debug macros on that test and made Travis run it 10 times in a row.

cloudant@fb13cf5

One failure:

https://travis-ci.org/cloudant/couchdb/jobs/252251466

test/couch_replicator_use_checkpoints_tests.erl:77:<0.30989.1>: <-

        test/couch_replicator_use_checkpoints_tests.erl:80:<0.30989.1>: <-

[done in 0.659 s]

test/couch_replicator_use_checkpoints_tests.erl:87:<0.30989.1>: <-

test/couch_replicator_use_checkpoints_tests.erl:80:<0.30989.1>: <-

test/couch_replicator_use_checkpoints_tests.erl:89:<0.30989.1>: <-

test/couch_replicator_use_checkpoints_tests.erl:91:<0.30989.1>: <-

test/couch_replicator_use_checkpoints_tests.erl:93:<0.30989.1>: <-

    *unexpected termination of test process*

::killed

test/couch_replicator_use_checkpoints_tests.erl:50:<0.916.0>: <-

  [done in 5.419 s]

[done in 5.419 s]

nickva added a commit to cloudant/couchdb that referenced this issue Jul 11, 2017
Because `stop/1` is asynchronous, it only casts a stop message and as result
the client process could end getting killed during termination/cleanup phase if
this sequence of events took place:

1. Client calls `stop(ListerPid).`
2. couch_event_sup casts a `stop` message to couch_event_sup gen_server
3. `stop` message is delayed and client continues executing.
4. Client calls something like application:stop/1`.
5. `application:stop/1`couch_replicator) terminates couch_event_sup gen_server.
6. Termination of the application kills client process because it is still linked

Issue apache#644
nickva added a commit to cloudant/couchdb that referenced this issue Jul 11, 2017
Because `stop/1` is asynchronous, and casts a stop message and as result the
client process could end getting killed during termination/cleanup phase if
this sequence of events took place:

1. Client calls `stop(ListerPid).`

2. couch_event_sup casts a `stop` message to couch_event_sup gen_server

3. `stop` message is delayed and client continues executing.

4. Client calls something like application:stop/1`.

5. `application:stop/1` terminates couch_event_sup gen_server.

6. App termination kills client process because it is still linked.

So this make the stop synchrounous by using call instead of cast.

Issue apache#644
nickva added a commit to cloudant/couchdb that referenced this issue Jul 11, 2017
This is to help to monitor test flakiness progress.

Issue apache#644
nickva added a commit that referenced this issue Jul 11, 2017
Because `stop/1` is asynchronous, and casts a stop message and as result the
client process could end getting killed during termination/cleanup phase if
this sequence of events took place:

1. Client calls `stop(ListerPid).`

2. couch_event_sup casts a `stop` message to couch_event_sup gen_server

3. `stop` message is delayed and client continues executing.

4. Client calls something like application:stop/1`.

5. `application:stop/1` terminates couch_event_sup gen_server.

6. App termination kills client process because it is still linked.

So this make the stop synchrounous by using call instead of cast.

Issue #644
nickva added a commit to cloudant/couchdb that referenced this issue Jul 11, 2017
This is to help to monitor test flakiness progress.

Issue apache#644
@wohali
Copy link
Member Author

wohali commented Jul 11, 2017

Closing until we see a recurrence of this because of #662.

@wohali wohali closed this as completed Jul 11, 2017
lag-linaro pushed a commit to lag-linaro/couchdb that referenced this issue Oct 25, 2018
nickva pushed a commit to nickva/couchdb that referenced this issue Sep 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants