Skip to content

Make couch_event_sup:stop/1 synchronous - #662

Merged
nickva merged 1 commit into
apache:masterfrom
cloudant:fix-issue-664
Jul 11, 2017
Merged

Make couch_event_sup:stop/1 synchronous#662
nickva merged 1 commit into
apache:masterfrom
cloudant:fix-issue-664

Conversation

@nickva

@nickva nickva commented Jul 11, 2017

Copy link
Copy Markdown
Contributor

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

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
@wohali

wohali commented Jul 11, 2017

Copy link
Copy Markdown
Member

+1

@nickva
nickva merged commit cc668ba into apache:master Jul 11, 2017
@nickva
nickva deleted the fix-issue-664 branch July 11, 2017 18:28
nickva pushed a commit to nickva/couchdb that referenced this pull request Sep 7, 2022
Added a note regarding max_partition_size
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

Successfully merging this pull request may close these issues.

2 participants