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

Add retry to nocredentials error #24

Merged
merged 5 commits into from
Dec 19, 2024
Merged

Conversation

njmei
Copy link
Collaborator

@njmei njmei commented Dec 17, 2024

A number of private functions (thankfully) had misspelled names
(`moint` -> `mount`). This commit corrects them.
The `_detect_mount_points_from_batch_job()` function is obtaining its
client in a slightly different way compared to the lambda version
(`_detect_mount_points_from_lambda()`).

This commit just standardizes the client instantiation method so that
the batch version matches the lambda version of the function.
During a merscope pipeline analysis run, a dist-data-sync:
Batch Data Sync Batch SubmitJob API call failed due to the following
proximal causes:

```
File "/var/task/aibs_informatics_aws_utils/efs/mount_point.py", line 385, in detect_mount_points
batch_mp_configs = _detect_moint_points_from_batch_job(batch_job_id)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/var/task/aibs_informatics_aws_utils/efs/mount_point.py", line 464, in _detect_moint_points_from_batch_job
response = batch.describe_jobs(jobs=[batch_job_id])
```

The last `batch.describe_jobs()` call eventually resulted in the error:
`botocore.exceptions.NoCredentialsError: Unable to locate credentials`

This commit tries to fix this by adding a retry to the
`detect_mount_points()` function (which calls the
`_detect_moint_points_from_batch_job() function) as well as a
lambda version. This retry will only do so if a
`NoCredentialsError` is encountered under the assumption that
such an error is ephemeral.
@rpmcginty rpmcginty force-pushed the add-retry-to-nocredentials-error branch from 3afbe6a to b4414dd Compare December 18, 2024 21:56
@rpmcginty rpmcginty merged commit 3e75ba3 into main Dec 19, 2024
4 checks passed
@rpmcginty rpmcginty deleted the add-retry-to-nocredentials-error branch December 19, 2024 18:23
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.

3 participants