Open
Conversation
Error: Uncaught Amp\Beanstalk\DeadlineSoonException causing the ESB to crash Caused by: Wrong Beanstalk job deleted at the end of the job Caused by: Multiple Beanstalk jobs for the same job UUID. With multiple concurrent workers that same job UUID will be assigned to multiple workers. $uuidToBeanstalkIdMap[$job->getUuid()] will then only contain one of the beanstalk job ids, so one of the worker's queue manager won't be able to delete his job after finish. Caused by: Concurrent calls to QueueManager::processBatch() were possible (and should be possible), but the batch itself was shared over multiple HTTP requests. Causing the same job being inserted twice (or more). Resolved by: Processing the batch via a local variable instead of the shared property.
The Combination PHP <7.4 and maglnet/composer-require-checker doesn't work with Composer 2. User Composer version 1 for PHP 7.2 and 7.3.
Newer versions causing errors: ECS >= 8.3: PHP Fatal error: Uncaught OutOfBoundsException: Package "symplify/easy-coding-standard" is not installed in phar:///home/youwe/Projects/webgriffe-esb/vendor/phpstan/phpstan/phpstan.phar/vendor/composer/InstalledVersions.php:1081 PhpStan >= 0.12.67: Ignored error pattern /Unable to resolve the template type .*? in call to function Amp\\call/ was not matched in reported errors. Ignored error pattern /Unable to resolve the template type .*? in instantiation of class Amp\\Producer/ was not matched in reported errors.
PhpStan: Method Webgriffe\Esb\Exception\ElasticSearch\JobNotFoundException::__construct() has parameter $code with no typehint specified.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix concurrency issue in QueueManager::processBatch
Error: Uncaught Amp\Beanstalk\DeadlineSoonException causing the ESB to crash
Caused by: Wrong Beanstalk job deleted at the end of the job
Caused by: Multiple Beanstalk jobs for the same job UUID. With multiple concurrent workers that same job UUID will be assigned to multiple workers. $uuidToBeanstalkIdMap[$job->getUuid()] will then only contain one of the beanstalk job ids, so one of the worker's queue manager won't be able to delete his job after finish.
Caused by: Concurrent calls to QueueManager::processBatch() were possible (and should be possible), but the batch itself was shared over multiple HTTP requests. Causing the same job being inserted twice (or more).
Resolved by: Processing the batch via a local variable instead of the shared property.
Steps to reproduce:
for n in {1..10}; do curl 'http://localhost:34981/my-url' 2>/dev/null >/dev/null & donePs. I cherry-picked some commits from my other PR's that were required for the travis-ci checks. The main commit in this PR is of course the first one.