Skip to content

Use "describe_table" not "create_table" to check for existence of DynamoDB table - #7734

Merged
auvipy merged 2 commits into
celery:masterfrom
maxfirman:fix-dynamo-create-table
Aug 31, 2022
Merged

auvipy merged 2 commits into
celery:masterfrom
maxfirman:fix-dynamo-create-table

Conversation

@maxfirman

Copy link
Copy Markdown
Contributor

Fixes #6622 by testing for existence of table using describe_table rather than create_table

@auvipy auvipy added this to the 5.3 milestone Aug 31, 2022
@codecov

codecov Bot commented Aug 31, 2022 •

Copy link
Copy Markdown

Codecov Report

Merging #7734 (a03ac13) into master (fbae71c) will not change coverage.
The diff coverage is 85.71%.

@@           Coverage Diff           @@
##           master    #7734   +/-   ##
=======================================
  Coverage   89.76%   89.76%           
=======================================
  Files         138      138           
  Lines       17004    17004           
  Branches     2513     2513           
=======================================
  Hits        15263    15263           
  Misses       1490     1490           
  Partials      251      251           
Flag Coverage Δ
unittests 89.74% <85.71%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
celery/backends/dynamodb.py 97.75% <85.71%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@auvipy auvipy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure about the cod coverage, can we improve it or the codcov is generating wrong coverage?

@maxfirman

Copy link
Copy Markdown
Contributor Author

@auvipy apologies my commit with refactored tests didn't get pushed yesterday for some reason. I've just pushed it now.

@auvipy
auvipy merged commit 876cc92 into celery:master Aug 31, 2022
auvipy added a commit that referenced this pull request Nov 24, 2026
…sses race to create the result table (#11106)

When the result table does not exist yet, every pool process tries to
create it on its first write. The losers' create_table raises
ResourceInUseException, which _get_or_create_table let through, so the
result write failed and the task was stored as FAILURE although it ran.
Treat the error as 'another process is creating it': wait for the table
to become ACTIVE and describe it, as the backend did before #7734.

Co-authored-by: Asif Saif Uddin {"Auvi":"অভি"} <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dynamoDB result backend incorrect exception handling when table exists

2 participants