Fix Workers Connecting to Broker Twice #1620
Merged
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 applied.
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.
Many of the workers have shown in the logs that they connected to the broker twice. While it hasn't seemed to cause any issues, it does not need to be happening. I figured out that the method call for a worker to connect to the broker was being made in the
__init__
method of theWorker
class and theWorkerGitInterfaceable
class. And since theWorkerGitInterfaceable
class inherits from theWorker
class, any time theWorkerGitInterfaceable
class is instantiated, the broker is connected to twice. With a worker this happens because most of them inherit fromWorkerGitInterfaceable
. As additional proof that this is the issue, you can see that workers (facade worker) that inherit from just theWorker
class don't have the issue, but workers (github_worker, pr_worker, gitlab_issues_worker) that inherit fromWorkerGitInterfaceable
do.