[Buildbot] #3596: Multiple services of same type not working properly

Buildbot trac trac at buildbot.net
Fri Aug 19 20:19:42 UTC 2016


#3596: Multiple services of same type not working properly
---------------------+--------------------
Reporter:  aomighty  |       Owner:
    Type:  defect    |      Status:  new
Priority:  major     |   Milestone:  0.9.+
 Version:  master    |  Resolution:
Keywords:            |
---------------------+--------------------
Description changed by sa2ajj:

Old description:

> Hi,
>
> I tried to configure my buildbot installation to use multiple services,
> but I found that, if given a list of services of the same type, only the
> last service in the list takes effect. For example, in the below code:
>
> {{{
> a = MailNotifier(...)
> b = MailNotifier(...)
> c['services'] = [a, b]
> }}}
>
> Only service b will actually get registered. Tracing through the code
> this is due to line 757 in config.py, in which services are indexed by
> name:
>
> self.services[_service.name] = _service
>
> However, each service of the same type gets the same name (in this case,
> just "MailNotifier"). In my own code, I have done a workaround of
> manually assigning the "name" property to each service to something
> unique before setting c['services']. After that, things seem to be
> working properly.
>
> There's a number of ways to resolve this issue, such as not indexing by
> name, automatically generating unique names, or forcing the user to set a
> name. As I'm new to the buildbot codebase, I don't know which way is most
> appropriate, but I wanted to mention the behavior, as it's very confusing
> and required in-depth code reading/debugging to root-cause. Nothing gets
> mentioned in the logs, as the other services in the list are silently
> clobbered.
>
> Note that I'm using the latest pip version: 0.9.0rc1.
>
> Thanks!

New description:

 Hi,

 I tried to configure my buildbot installation to use multiple services,
 but I found that, if given a list of services of the same type, only the
 last service in the list takes effect. For example, in the below code:

 {{{
 a = MailNotifier(...)
 b = MailNotifier(...)
 c['services'] = [a, b]
 }}}

 Only service b will actually get registered. Tracing through the code this
 is due to line 757 in config.py, in which services are indexed by name:

 self.services[_service.name] = _service

 However, each service of the same type gets the same name (in this case,
 just "!MailNotifier"). In my own code, I have done a workaround of
 manually assigning the "name" property to each service to something unique
 before setting `c['services']`. After that, things seem to be working
 properly.

 There's a number of ways to resolve this issue, such as not indexing by
 name, automatically generating unique names, or forcing the user to set a
 name. As I'm new to the Buildbot code base, I don't know which way is most
 appropriate, but I wanted to mention the behavior, as it's very confusing
 and required in-depth code reading/debugging to root-cause. Nothing gets
 mentioned in the logs, as the other services in the list are silently
 clobbered.

 Note that I'm using the latest pip version: 0.9.0rc1.

 Thanks!

--

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


More information about the bugs mailing list