Opened 8 years ago

Closed 8 years ago

#2208 closed defect (fixed)

GerritChangeSource: orphan SSH process

Reported by: sanxiyn Owned by:
Priority: minor Milestone: 0.8.+
Version: 0.8.5 Keywords: gerrit


When you stop a buildmaster using GerritChangeSource? you get:

[-] Received SIGTERM, shutting down.
[-] starting 'gerrit stream-events'
[-] Main loop terminated.
[-] Server Shut Down.

That is, GerritChangeSource? restarts 'gerrit stream-events' SSH process while the buildmaster is shutting down. This results in an orphan SSH process.

Change History (4)

comment:1 Changed 8 years ago by tom.prince

This is probably best handled by using twisted.conch to connect to the server, instead of calling out to ssh as a seperate process.

comment:2 Changed 8 years ago by tom.prince

  • Milestone changed from undecided to 0.8.+
  • Priority changed from major to minor

comment:3 Changed 8 years ago by dustin


    def stopService(self):
        if self.process:

is killing the process, and then

    def streamProcessStopped(self):
        self.process = None

        # if the service is stopped, don't try to restart
        if not self.parent:
            log.msg("service is not running; not reconnecting")

is re-starting it. The check for self.parent is not the same as self.running which is, sadly, an undocumented attribute of service.Service.

I think that the fix here is to add a new attribute to track whether the process should be running.

comment:4 Changed 8 years ago by Dustin J. Mitchell

  • Resolution set to fixed
  • Status changed from new to closed

Track the status of the gerritChangeSource process

separately from self.parent, which does not mean 'running'

Fixes #2208.

Changeset: 097fedf23a93cb6c67395eb4b0fd5a719889a2f4

Note: See TracTickets for help on using tickets.