[Buildbot-commits] [Buildbot] #2387: gerritchangesource leaves background ssh process running after buildbot master process stops

Buildbot nobody at buildbot.net
Sat Dec 1 00:11:19 UTC 2012


#2387: gerritchangesource leaves background ssh process running after buildbot
master process stops
---------------------+--------------------
Reporter:  hushp1pt  |       Owner:
    Type:  defect    |      Status:  new
Priority:  minor     |   Milestone:  0.8.8
 Version:  0.8.7     |  Resolution:
Keywords:  gerrit    |
---------------------+--------------------

Comment (by dustin):

 I can't confirm.  I just put a very basic config in using
 gerritchangesource, and added {{{print 'STOP'}}} to stopService:

 {{{
 #!patch
 diff --git a/master/buildbot/changes/gerritchangesource.py
 b/master/buildbot/changes/gerritchangesource.py
 index 62bf6a8..cf95f97 100644
 --- a/master/buildbot/changes/gerritchangesource.py
 +++ b/master/buildbot/changes/gerritchangesource.py
 @@ -183,10 +183,12 @@ class GerritChangeSource(base.ChangeSource):
            [ "ssh" ] + args + [ "gerrit", "stream-events" ])

      def startService(self):
 +        print "START"
          self.wantProcess = True
          self.startStreamProcess()

      def stopService(self):
 +        print "STOP"
          self.wantProcess = False
          if self.process:
              self.process.signalProcess("KILL")
 }}}
 and the logs show me a start and a stop:
 {{{
 2012-11-30 19:10:06-0500 [-] Log opened.
 2012-11-30 19:10:06-0500 [-] twistd 12.2.0
 (/home/dustin/code/buildbot/t/buildbot/sand27/bin/python2.7 2.7.3)
 starting up.
 2012-11-30 19:10:06-0500 [-] reactor class:
 twisted.internet.epollreactor.EPollReactor.
 2012-11-30 19:10:06-0500 [-] Starting BuildMaster -- buildbot.version:
 0.8.7p1-172-g4ccb2c8
 2012-11-30 19:10:06-0500 [-] Loading configuration from
 '/home/dustin/code/buildbot/t/buildbot/sand27/master/master.cfg'
 2012-11-30 19:10:06-0500 [-] unable to import dnotify, so Maildir will use
 polling instead
 2012-11-30 19:10:06-0500 [-] Setting up database with URL
 'sqlite:///state.sqlite'
 2012-11-30 19:10:06-0500 [-] setting database journal mode to 'wal'
 2012-11-30 19:10:06-0500 [-] adding 3 new changesources, removing 0
 2012-11-30 19:10:06-0500 [-] START
 2012-11-30 19:10:06-0500 [-] starting 'gerrit stream-events'
 2012-11-30 19:10:06-0500 [-] PBServerFactory starting on 9989
 2012-11-30 19:10:06-0500 [-] Starting factory
 <twisted.spread.pb.PBServerFactory instance at 0x2576560>
 2012-11-30 19:10:06-0500 [-] adding 1 new slaves, removing 0
 2012-11-30 19:10:06-0500 [-] adding 1 new builders, removing 0
 2012-11-30 19:10:06-0500 [-] trying to load status pickle from
 /home/dustin/code/buildbot/t/buildbot/sand27/master/builder/builder
 2012-11-30 19:10:06-0500 [-] no saved status pickle, creating a new one
 2012-11-30 19:10:06-0500 [-] added builder builder in category x7
 2012-11-30 19:10:06-0500 [-] adding scheduler 'a'
 2012-11-30 19:10:06-0500 [-] gerrit stderr: ssh: Could not resolve
 hostname svr: Name or service not known

 2012-11-30 19:10:06-0500 [-] 'gerrit stream-events' failed; restarting
 after 1s
 2012-11-30 19:10:06-0500 [-] adding scheduler 'all'
 2012-11-30 19:10:06-0500 [-] adding scheduler 'force'
 2012-11-30 19:10:06-0500 [-] adding scheduler 'goaheadtryme'
 2012-11-30 19:10:06-0500 [-] PBServerFactory starting on 8888
 2012-11-30 19:10:06-0500 [-] Starting factory
 <twisted.spread.pb.PBServerFactory instance at 0x242ee18>
 2012-11-30 19:10:06-0500 [-] WebStatus using
 (/home/dustin/code/buildbot/t/buildbot/sand27/master/public_html)
 2012-11-30 19:10:06-0500 [-] RotateLogSite starting on 8010
 2012-11-30 19:10:07-0500 [-] Starting factory
 <buildbot.status.web.baseweb.RotateLogSite instance at 0x2430950>
 2012-11-30 19:10:07-0500 [-] Setting up http.log rotating 10 files of
 10000000 bytes each
 2012-11-30 19:10:07-0500 [-] BuildMaster is running
 2012-11-30 19:10:07-0500 [-] starting 'gerrit stream-events'
 2012-11-30 19:10:07-0500 [-] gerrit stderr: ssh: Could not resolve
 hostname svr: Name or service not known

 2012-11-30 19:10:07-0500 [-] 'gerrit stream-events' failed; restarting
 after 1s
 2012-11-30 19:10:08-0500 [-] starting 'gerrit stream-events'
 2012-11-30 19:10:08-0500 [-] gerrit stderr: ssh: Could not resolve
 hostname svr: Name or service not known

 2012-11-30 19:10:08-0500 [-] 'gerrit stream-events' failed; restarting
 after 1s
 ^C2012-11-30 19:10:08-0500 [-] Received SIGINT, shutting down.
 2012-11-30 19:10:08-0500 [-] STOP
 2012-11-30 19:10:08-0500 [-] (TCP Port 8010 Closed)
 2012-11-30 19:10:08-0500 [-] Stopping factory
 <buildbot.status.web.baseweb.RotateLogSite instance at 0x2430950>
 2012-11-30 19:10:08-0500 [-] (TCP Port 8888 Closed)
 2012-11-30 19:10:08-0500 [-] Stopping factory
 <twisted.spread.pb.PBServerFactory instance at 0x242ee18>
 2012-11-30 19:10:08-0500 [-] (TCP Port 9989 Closed)
 2012-11-30 19:10:08-0500 [-] Stopping factory
 <twisted.spread.pb.PBServerFactory instance at 0x2576560>
 2012-11-30 19:10:08-0500 [-] Main loop terminated.
 2012-11-30 19:10:08-0500 [-] Server Shut Down.
 }}}

 Relevant bits of the config:
 {{{
 from buildbot.changes.gerritchangesource import GerritChangeSource
 c['changeHorizon'] = None
 c['change_source'] = [
   GerritChangeSource('svr', 'usr'),
   #SVNPoller(svnurl='http://svn.r.igoro.us/projects/toys/Processor/',
 pollinterval=120, split_file=split_file_branches),
   PBChangeSource(port=9989),
   GitPoller('/home/dustin/code/buildbot/t/testrepo/', branch='master',
 pollinterval=3, project='foo', workdir=os.path.abspath('gitpoller-work')),
 ]
 }}}

-- 
Ticket URL: <http://trac.buildbot.net/ticket/2387#comment:6>
Buildbot <http://buildbot.net/>
Buildbot: build/test automation


More information about the Commits mailing list