Allow passing existing node to IntrospectionServer to avoid duplicate node name #130
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be appl
2D87
ied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
IntrospectionServer
inheriting fromNode
is problematic when instancing it in a Python executable containing another node instance, which is likely the most common use case. In particular, the problem commonly arises when starting such executable from a launch file. In that case, the CLI arguments used by the launch system to set the node name will end up affecting both the nodes, resulting in duplicate nodes with the same name.This MR proposes a possible fix by allowing to optionally pass an existing node instance to the
IntrospectionServer
class constructor.Now
server_name
and the optionalnode
i 8000 n the constructor are somewhat redundant. I would've rather removedserver_name
altogether but it would break backward compatibility. Assuming the current situation quite broken as it is you may consider it fine to do so and I'll be happy to change it if you want.