Skip to content

Commit

Permalink
terminate the server tailing process on exit
Browse files Browse the repository at this point in the history
Summary:
We were running into an issue where the pyre incremental process would terminate,
but leave behind a process tailing server.stdout - meant to give progress messages. Register a function
to terminate said tailer at the exit of the program.

Reviewed By: dark

Differential Revision: D7979191

fbshipit-source-id: 8ab0167cb9e7b07c547fcb56c1544dfe17e04c6b
  • Loading branch information
sinancepel authored and facebook-github-bot committed May 12, 2018
1 parent 827ced9 commit f033843
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/commands/incremental.py
Expand Up @@ -3,6 +3,7 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

import atexit
import logging
import subprocess
import os
Expand Down Expand Up @@ -36,6 +37,7 @@ def _read_stderr(self, _stream, source_directory):
['tail', '-f', stderr_file],
stdout=subprocess.PIPE,
stderr=subprocess.DEVNULL) as stderr_tail:
atexit.register(stderr_tail.terminate)
super(Incremental, self)._read_stderr(
stderr_tail.stdout,
source_directory)
Expand Down

0 comments on commit f033843

Please sign in to comment.