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

Before Change


    // 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):

After Change


    server = ReportingServerManager(self.context, self.get_options())

    if not server.is_alive():
      logger.info("No server found.")
      return

    pid = server.pid
Italian Trulli
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: jsalt18-sentence-repl/jiant
Commit Name: b99870ac55f3773ff2cd59fc298f9a4f987589da
Time: 2018-06-29
Author: elliepavlick@gmail.com
File Name: src/main.py
Class Name:
Method Name: main


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 7e2ce3a6cd51b21218ccc281dc21626153221778
Time: 2020-11-19
Author: pclay@google.com
File Name: perfkitbenchmarker/scripts/spark_sql_runner.py
Class Name:
Method Name: main