-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: await for describe queue subscription when subscribing to queues #144
base: develop
Are you sure you want to change the base?
Conversation
Queue with meta without any describe queue will lead to timeout when calling {qualifier}:describe hence we should await for its subscription as well
@@ -474,7 +475,7 @@ function Carotte(config) { | |||
const exchangeName = getExchangeName(options); | |||
const queueName = getQueueName(options, config); | |||
|
|||
return Promise.race([ | |||
return Promise.race(promises.concat([ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum I think this is a breaking change. Previously the function was returning a Promise<ActualQueue>
and is now returning a Promise<ActualQueue | DescribeQueue>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, will be better to just wait for it but still return the actual queue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I was confused as of why we raced this promise with the other ones (timeout and "subscribeToActualQueue"). Just awaiting it should work just as well, right?
I'm sorry, I did not quite understand how the issue was happening and how this change fixes it? Since subscribing to a describe queue goes through |
Because describe queue creation is handled when base queue is created through a call to Also I don't think having a global |
I agree with this:
From there, I think awaiting the "subscribe to describe" promise is the simplest solution. But maybe we could also run it in parallel with the await Promise.all([
Promise.race(timeoutPromise, subscribeToActualQueuePromise),
subscribeToDescribeQueuePromise,
]); This way we don't delay the "actual" subscribe as much, but it's probably only saving some milliseconds |
Context
Masterbag inbound process failing sometimes.
https://cubyn.slack.com/archives/C3US319PA/p1661962354346349
TL;DR inbound was correctly done but missing describe queue was raising an error when refreshing the list of in transit masterbags.
Description
Queue with meta without any describe queue will most likely lead to timeout when calling {qualifier}:describe hence I think we should wait for its subscription as well.