Gracefully handle QuotaExhaustedException
- Dominant language
- Dart
- Stars
- 944
- Forks
- 184
- Avg merge
- 1d 15h
- Merged PRs (30d)
- 12
Description
Since this isn't a bad error, it should probably just be a warning, and written in a manner that we know that it might happen from time to time.
When we have two instances running, it's likely to happen because while they can count instances, they'll both try to schedule as many as possible.
```
pub.task.schedule: Quota exhausted trying to create worker-01gvnbwemd8bshnn5h6vv9yfb5, banning all zones for 10 minutes
Error:
QuotaExhaustedException: Quota exceeded creating instance, api.instances.insert(name=worker-01gvnbwemd8bshnn5h6vv9yfb5), error: QUOTA_EXCEEDED: Quota 'PREEMPTIBLE_CPUS' exceeded. Limit: 2000.0 in region us-central1.
Stack:
#0 _GoogleCloudCompute.createInstance.logWarningsThrowErrors (package:pub_dev/task/cloudcompute/googlecloudcompute.dart:571:15)
#1 _GoogleCloudCompute.createInstance (package:pub_dev/task/cloudcompute/googlecloudcompute.dart:599:9)
#2 StackZoneSpecification._registerUnaryCallback. (package:stack_trace/src/stack_zone_specification.dart:124:15)
```
Contributor guide
Research direction
Start in package/pub_dev/task/cloudcompute/googlecloudcompute.dart at createInstance and logWarningsThrowErrors around lines 571 and 599. Trace how QuotaExhaustedException is handled, then verify that quota exhaustion is reported as a warning rather than an unexpected error and that the existing scheduling behavior remains clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, google-cloud
- Domain
- cloud
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100