Skip to content

Transient query execution failures when CI runs overlap #804

Description

@laughingman7743

Problem

Parallel CI runs across pull requests share one AWS account. #786 / #803 make the metadata API path tolerate throttling by answering from Glue. The query execution path has no equivalent, and it still fails transiently when several runs overlap.

Observed in run 35889837530 (PR #803 at ec384d2, running at the same time as the docs/790-notice run):

ERROR tests/sqlalchemy/test_suite.py::DateHistoricTest_awsathena+aiorest_async::test_select_direct
pyathena.error.OperationalError: Amazon Athena experienced an internal error while executing this query.
Please try submitting the query again and if the issue reoccurs, contact AWS support for further assistance.
[SQL: DELETE FROM date_table]

That was 1 of the 15 jobs; the other 14 passed. The query reached a terminal FAILED state. execute() reports that as OperationalError and does not resubmit, because only API-call errors are retried (RetryConfig).

.github/workflows/test.yaml also records a second class of overlap failure: the account's concurrent-query quota (TooManyRequestsException on StartQueryExecution). The default RetryConfig retries it with backoff, but the retry budget is shared with every other overlapping run.

Questions to settle before a change

  1. Which terminal query failures are safe to resubmit, and for which statement types?
    • Athena's message explicitly asks for resubmission.
    • A resubmitted DML or DDL statement may not be idempotent.
    • The query's AthenaError (ErrorCategory / ErrorType / Retryable) may classify the failure. This is not yet verified for this error.
  2. Should resubmission be a library feature, opt-in or default, or only a test-suite fixture concern?
  3. For the concurrent-query quota: is the remaining failure mode the retry budget, or the number of workers across overlapping runs? This needs measuring, as Investigate persistent metadata throttling during SQLAlchemy reflection #780 did for metadata throttling.

Context

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions