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

Unify exception management in QueueCommand #27

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

Conversation

giorgiosironi
Copy link
Contributor

  • Full coverage for QueueCommand
  • Put all catch() blocks in a single place and deduplicate them
  • Use finally to ensure commit() call happens
  • Avoid multiple commit() calls in any scenario
  • Remove dead release() method

@giorgiosironi giorgiosironi requested a review from nlisgo November 21, 2017 14:21
$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()})", [
Copy link
Member

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).

Copy link
Contributor Author

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);
Copy link
Member

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?

Copy link
Contributor Author

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.

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