Services are sharing private tools
I found this rather unexpected behavior when using private tools (that are instantiated with the same name) in a service. Here is a reproducer (after applying fwinkl/Gaudi@a73fc4b4 to the SvcWithTool
example):
from GaudiExamples.GaudiExamplesConf import GaudiTesting__SvcWithTool, MyTool
svc1 = GaudiTesting__SvcWithTool('svc1')
svc2 = GaudiTesting__SvcWithTool('svc2')
svc1.MyPrivateTool = MyTool("tool")
svc1.MyPrivateTool.getParent()
'svc1'
svc2.MyPrivateTool = MyTool("tool")
svc2.MyPrivateTool.getParent()
'svc2'
svc1.MyPrivateTool.getParent()
'svc2' # !!! the parent changed and both tools are actually the same:
id(svc1.MyPrivateTool)
139758714546496
id(svc2.MyPrivateTool)
139758714546496
This is because ConfigurableService
shares all its children. If you remove the copyChild
override, it works as expected. But not sure what else relies on this behavior. I quite surprised we have not seen problems with this before. But maybe a service with a private tool is not very common.
Edited by Frank Winklmeier