-
Notifications
You must be signed in to change notification settings - Fork 0
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
67 refactor implementation of left over job queues clean up #80
67 refactor implementation of left over job queues clean up #80
Conversation
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.
Great manual testing to ensure all edge cases are understood/working. Thanks for a great PR!
@cwang39403 Apologies for misunderstanding your question here! I believe last week you intended to check if it should be the case that the Job progress & status queues remained while the result queue was deleted in this case? I originally understood that you meant to ask if it is okay if the job progress and status queues are deleted later than the job result queue. However, this behavior that you found does appear weird and warrants some investigation. I would expect that all 3 queues are deleted by the SDK after receiving a job result regardless if it reconnected. Shall we open a ticket for this? Or I am misunderstanding again? Thanks for your thoroughness! |
@lfse-slafleur No worries, I didn't explain clearly enough during our weekly standup. Although in scenario 3, job progress and status queues will eventually be removed when reaching TTL (which fulfills the cleanup requirement), they are not deleted immediately after SDK consumes a job result message is indeed what I tried to point out. My initial guess is there are some competing situations resulting in this outcome (reconnecting to queues & removing the job result queue after the job result message is consumed), but I am not entirely sure. Yes, could you create a ticket for this? |
@lfse-slafleur I had a further look into the behavior of scenario 3. Looking at the logs. When the job result message is being consumed and the queue is being removed (which also triggers *When we say reconnect to the queue, it actually redeclares the queue: If we wait the execution of Curious about your thoughts. |
@cwang39403 Good find! We can probably fix this by switching the declarations around. You can put the https://github.com/Project-OMOTES/omotes-sdk-python/blob/main/src/omotes_sdk/omotes_interface.py#L266 declaration at the bottom and then it will ensure the other queues exist before the result queue is connected. We should also ensure that we document this in the code that the order of declarations is important and why. |
@lfse-slafleur Yes, good suggestion! I implemented and tested with scenario 3 again and it works properly now! |
Related to issues: #67, Project-OMOTES/omotes-system#80
Removed job result dead letter queue, dead letter exchange, and message TTL implementation to avoid SDK client reconnection occurring after the job result message is already dead-lettered and the SDK client will be waiting infinitely.
Tested manually with the following scenarios
1. Happy path
2. Immediate reconnect
3. Reconnect after the job is finished
4. Never reconnect
5. Reconnect after queues have already expired