Properly close internal reply queues when collecting queue stats #8349
+12
−4
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.
What does this PR do?
Close internal reply queue when collecting queue stats.
Motivation
A customer reported that "the Agent writes to a dead-letter queue associated to
PYMQPCF.*
, but we monitor on all DLQ so this causes alerts in production", and they would like the Agent to not submit anything to these DLQ. These writes occur in parallel to them seeing aWARNING
in the Agent logs due to a failure to fetch the queue stats.My understanding is that
PYMQPCF.*
is the prefix of internal queues (known as "reply queues") used bypymqi
when executing a command. Then here's my best theory of what happens with the DLQ:pymqi
pops messages from those queues to form the final response, leaving no undelivered messages and nothing in the DLQ.pcf.disconnect()
, the reply queue gets properly closed, so no messages will be marked as "undelivered" since the queue is disposed.I will create a beta off this branch to see if this theory holds and if it resolves the customer's issue with DLQ items. If it does, I will apply this
finally
block to everywhere we usePCFExecute
.Additional Notes
Review checklist (to be filled by reviewers)
changelog/
andintegration/
labels attached