fd1456ac36e0a1ebfb800c9593f1540858ca7bea,src/python/pants/backend/core/tasks/reporting_server.py,KillServer,execute,#KillServer#,114

Before Change


    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))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

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: IndicoDataSolutions/finetune
Commit Name: c66273e95dd94e5553a4ea3066c60ccc566cad5d
Time: 2020-04-13
Author: madison@indico.io
File Name: tests/test_scheduler.py
Class Name: TestScheduler
Method Name: setUpClass


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: deepfakes/faceswap
Commit Name: 2b4ae91b02d0b3b42e2a634c4f432df6d20d3b7c
Time: 2018-11-04
Author: 36920800+torzdf@users.noreply.github.com
File Name: lib/gui/wrapper.py
Class Name: FaceswapControl
Method Name: terminate