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

Comments

Projects
None yet
2 participants
@wohali
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

This comment has been minimized.

Show comment
Hide comment
@nickva

nickva Jul 11, 2017

Contributor

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]
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

Unlink before stopping a linked couch_event listener
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 #644

nickva added a commit to cloudant/couchdb that referenced this issue Jul 11, 2017

Make couch_event_sup:stop/1 synchronous
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

Temporarily try running more Travis builds
This is to help to monitor test flakiness progress.

Issue #644

nickva added a commit that referenced this issue Jul 11, 2017

Make couch_event_sup:stop/1 synchronous
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

Temporarily try running more Travis builds
This is to help to monitor test flakiness progress.

Issue #644
@wohali

This comment has been minimized.

Show comment
Hide comment
@wohali

wohali Jul 11, 2017

Member

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

Member

wohali commented Jul 11, 2017

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

@wohali wohali closed this Jul 11, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment