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

Changes cache hosts warning / critical levels and continue on multiple hosts #18852

Merged
merged 9 commits into from
Feb 15, 2019

Conversation

wiardvanrij
Copy link
Contributor

@wiardvanrij wiardvanrij commented Oct 27, 2018

Description (*)

When purging varnish hosts it could be possible 1 or more hosts are unresponsive.
Two changes here:

  1. It should continue to purge other hosts even though 1 of the X servers is offline/unavailable.
  2. Provide a warning if more hosts are available and a critical if that was the only host

Fixed Issues (if relevant)

  1. CacheInvalidate : stop at first server not responding #18056: CacheInvalidate : stop at first server not responding
  2. ...

Manual testing scenarios (*)

  1. Have multiple cache hosts
  2. bin/magento cache:flush full_page

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@magento-engcom-team
Copy link
Contributor

Hi @wiardvanrij. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento-engcom-team give me test instance - deploy test instance based on PR changes
  • @magento-engcom-team give me $VERSION instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my propositions on the possible contribution improvement

app/code/Magento/CacheInvalidate/Model/PurgeCache.php Outdated Show resolved Hide resolved
lib/internal/Magento/Framework/Cache/InvalidateLogger.php Outdated Show resolved Hide resolved
@sivaschenko
Copy link
Member

Hi @wiardvanrij thank you for this useful contribution. I have an improvement proposition for this PR, that I described in the review comments. Please let me know what you think!

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the refactoring, please see the remaining comment about a couple of minor changes required

app/code/Magento/CacheInvalidate/Model/PurgeCache.php Outdated Show resolved Hide resolved
app/code/Magento/CacheInvalidate/Model/PurgeCache.php Outdated Show resolved Hide resolved
Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few final cosmetic changes required

$loggerMessage = implode(" ", $unresponsiveServerError);

if ($errorCount == count($servers)) {
$this->logger->critical('No cache server(s) could be purged ' . $loggerMessage, compact('server',
Copy link
Member

@sivaschenko sivaschenko Nov 14, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each parameter should be in line by itself in multiline function call, example:

$this->logger->critical(
    'No cache server(s) could be purged ' . $loggerMessage,
    compact('server', 'formattedTagsChunk')
);

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I think I misunderstood you :) It is changed now

app/code/Magento/CacheInvalidate/Model/PurgeCache.php Outdated Show resolved Hide resolved
@magento-engcom-team magento-engcom-team added this to the Release: 2.3.1 milestone Nov 15, 2018
@okorshenko okorshenko removed this from the Release: 2.3.1 milestone Jan 28, 2019
@ghost
Copy link

ghost commented Feb 15, 2019

Hi @wiardvanrij, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

@magento-engcom-team magento-engcom-team added this to the Release: 2.3.2 milestone Feb 15, 2019
magento-engcom-team pushed a commit that referenced this pull request Feb 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants