Skip to content
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

Make the queue clearable #26

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

rikmorskate
Copy link

@rikmorskate rikmorskate commented Jul 17, 2022

Added functionality to make the Azure queue clearable. This will make php artisan queue:clear work.

@squigg
Copy link
Owner

squigg commented Jul 19, 2022

Thanks for the contribution.

According to the documentation this method can still return 500 error with OperationTimedOut and suggests retrying. Perhaps we should handle this error and continually retry until the clearing has succeeded?

The behaviour of php artisan queue:clear would then be blocking until the queue is actually fully cleared, rather than potentially failing.

@rikmorskate
Copy link
Author

rikmorskate commented Aug 13, 2022

How about this?

@rikmorskate
Copy link
Author

rikmorskate commented Sep 21, 2022

@squigg What do you think of the solution I implemented?

@squigg
Copy link
Owner

squigg commented Sep 22, 2022

Hey, sorry for the delay. I think we need to be more specific about the ServiceException being caught here, as this exception can occur for many other reasons beyond just the timeout we are keen to retry on.

I had a quick look and it seems that the code that parses the response in ServiceException doesn't save the code property from the XML error format.

I'm not sure whether the errorText or errorMessage properties would include the OperationTimedOut error code or not, but if they don't then the full XML response is available and we could do a rudimentary check here to confirm whether or not it's failed for a timeout and just retry in that case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants