Skip to content

[BUG] Fails if encountering ThrottlingException from AWS for DescribeLogGroups request #86

@edruid

Description

@edruid

Describe the bug
If the DescribeLogGroups call encounters a ThrottlingException from AWS the logger will throw a CloudWatchLogsException
400 Bad Request
{"__type":"ThrottlingException","message":"Rate exceeded"}

Expected behavior
If exception is thrown, sleep 1 second and retry (at least once).

Please provide the steps to reproduce and if possible a minimal demo of the problem
Run 6 parallel processes all trying to initialize the CloudWatch handler within the same second

Please tell about your environment:

  • PHP Version: 7.2
  • Operating system (distro): AWS Linux
  • Application mode:
    • Web app
    • CLI app
    • Daemon worker

trace:
"/var/app/current/carrot/vendor/aws/aws-sdk-php/src/WrappedHttpHandler.php:100",
"/var/app/current/carrot/vendor/guzzlehttp/promises/src/Promise.php:203",
"/var/app/current/carrot/vendor/guzzlehttp/promises/src/Promise.php:174",
"/var/app/current/carrot/vendor/guzzlehttp/promises/src/RejectedPromise.php:40",
"/var/app/current/carrot/vendor/guzzlehttp/promises/src/TaskQueue.php:47",
"/var/app/current/carrot/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:104",
"/var/app/current/carrot/vendor/guzzlehttp/guzzle/src/Handler/CurlMultiHandler.php:131",
"/var/app/current/carrot/vendor/guzzlehttp/promises/src/Promise.php:246",
"/var/app/current/carrot/vendor/guzzlehttp/promises/src/Promise.php:223",
"/var/app/current/carrot/vendor/guzzlehttp/promises/src/Promise.php:267",
"/var/app/current/carrot/vendor/guzzlehttp/promises/src/Promise.php:225",
"/var/app/current/carrot/vendor/guzzlehttp/promises/src/Promise.php:267",
"/var/app/current/carrot/vendor/guzzlehttp/promises/src/Promise.php:225",
"/var/app/current/carrot/vendor/guzzlehttp/promises/src/Promise.php:62",
"/var/app/current/carrot/vendor/aws/aws-sdk-php/src/AwsClientTrait.php:58",
"/var/app/current/carrot/vendor/aws/aws-sdk-php/src/AwsClientTrait.php:86",
"/var/app/current/carrot/vendor/maxbanton/cwh/src/Handler/CloudWatch.php:285",
"/var/app/current/carrot/vendor/maxbanton/cwh/src/Handler/CloudWatch.php:248",
"/var/app/current/carrot/vendor/maxbanton/cwh/src/Handler/CloudWatch.php:172",
"/var/app/current/carrot/vendor/maxbanton/cwh/src/Handler/CloudWatch.php:150",
"/var/app/current/carrot/vendor/monolog/monolog/src/Monolog/Handler/AbstractProcessingHandler.php:39",
"/var/app/current/carrot/vendor/monolog/monolog/src/Monolog/Logger.php:344",
"/var/app/current/carrot/vendor/monolog/monolog/src/Monolog/Logger.php:637",
...

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions