-
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
Unify exception management in QueueCommand #27
base: master
Are you sure you want to change the base?
Conversation
$this->monitoring->endTransaction(); | ||
} catch (BadResponse $e) { | ||
// We got a 404 or server error. | ||
$this->logger->error("{$this->getName()}: Item does not exist in API: {$item->getType()} ({$item->getId()})", [ |
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.
Pre-existing problem, but 404/410 requires processing (eg unindex, delete local copy).
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.
It does, the default is ignore (but this still writes an error log) like for search
trying to index an unpublished article. Trying to keep existing behavior.
'item' => $item, | ||
]); | ||
$this->monitoring->recordException($e, "Error in processing {$item->getType()} {$item->getId()}"); | ||
} finally { | ||
$this->queue->commit($item); |
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.
Pre-existing, but we never retry?
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.
Discussing with @nlisgo we could introduce a configurable whitelist of exceptions that are allowed to retry. Requires looking at actual traffic and see which errors are frequently raised to put them into the list.
QueueCommand
catch()
blocks in a single place and deduplicate themfinally
to ensurecommit()
call happenscommit()
calls in any scenariorelease()
method