fd1456ac36e0a1ebfb800c9593f1540858ca7bea,src/python/pants/backend/core/tasks/reporting_server.py,KillServer,execute,#KillServer#,114
Before Change
if not info:
print("No server found.", file=sys.stderr)
// There should only be one pidfile, but in case there are many, we kill them all here.
for pidfile, pid, port in info:
with open(pidfile, "r") as infile:
pidstr = infile.read()
try:
os.unlink(pidfile)
pid = int(pidstr)
os.kill(pid, signal.SIGKILL)
print("Killed server with {pid} at http://localhost:{port}".format(pid=pid, port=port),
file=sys.stderr)
except (ValueError, OSError):
pass
After Change
try:
logger.info("Killing server with {pid} at http://localhost:{port}"
.format(pid=pid, port=server.socket))
server.terminate()
except ReportingServerManager.NonResponsiveProcess:
logger.info("Failed to kill server with pid {pid}!".format(pid=pid))
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: pantsbuild/pants
Commit Name: fd1456ac36e0a1ebfb800c9593f1540858ca7bea
Time: 2015-07-17
Author: kwilson@twopensource.com
File Name: src/python/pants/backend/core/tasks/reporting_server.py
Class Name: KillServer
Method Name: execute
Project Name: mozilla/bugbug
Commit Name: b7a17d323cdabaab6e6c2d4ea0d3d27685d9de7d
Time: 2019-12-10
Author: mcastelluccio@mozilla.com
File Name: bugbug/rust_code_analysis_server.py
Class Name: RustCodeAnalysisServer
Method Name: __init__
Project Name: rail-berkeley/softlearning
Commit Name: 4dd96193aaa69485ef183778f053fcfcbef457a2
Time: 2018-05-22
Author: azhou42@berkeley.edu
File Name: sac/algos/base.py
Class Name: RLAlgorithm
Method Name: _train