Home GnuPG

Fix some daemon errors related to multiple/out-of-order events
05e30630a4d3Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

Fix some daemon errors related to multiple/out-of-order events

Summary:
Ref T10811. Currently, we can emit the "willExit" event multiple times, or emit it and then emit a "log" event.

This causes some problems with the Phabricator listener, which cleans up resources the first time it sees this event. When it gets the second copy (or logs afterward) it fails to process events.

Instead, emit it only once we're actually cleaning up the daemon handle. This guarantees it emits last and emits exactly once.

I believe this only cleans up logs, but it's possible it also improves stability.

Test Plan:
You can reproduce this issue like this:

  • Run bin/phd debug hangforever.
  • Kill it with ^C^C.
  • Most of the time, it will emit errors.

With --trace, you can see additional information. After this patch, it no longer emits errors but still successfully marks the daemon as exited, and the willExit event is always emitted exactly once and emitted last.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T10811

Differential Revision: https://secure.phabricator.com/D15975

Details

Provenance
epriestley <git@epriestley.com>Authored on May 26 2016, 3:09 AM
Parents
rPHUTIL1d216e95b39c: Provide locale support for languages we've seen translations for
Branches
Unknown
Tags
Unknown

Event Timeline

epriestley <git@epriestley.com> committed rPHUTIL05e30630a4d3: Fix some daemon errors related to multiple/out-of-order events (authored by epriestley <git@epriestley.com>).May 26 2016, 5:08 PM