Merged
Conversation
* update smoot-design for new alerts * more smoot bumps * whoopsie-daisy * whooooopsie * remove an unnecessary element * fix a test * pin smoot to a real version
* Switch to v3 for program enrollments * Feedback * Feedback * Fix tests
* Do not use desctructing for build time static replacement * Destructuring is ok in server components, but consistency here should serve as a reminder
* reorganize UnstyledRawHtml, allow some extra tags * require https
* add context menu items to link to product pages * remove titleAction argument as it's not necessary anymore * fix logic surrounding marketing urls and add tests * program title link should go to program dashboard * check include_in_learn_catalog before adding show course details to context menu * remove unnecessary array wrapper * remove unnecessary router usage * card title should perform enrollment when applicable * fix tests after rebase * fix issue with getting legacy product page URL from v3 program enrollment * use readable id to construct legacy program product page url
…peline to create it (#2938)
* fix: change byline author behaviour --------- Co-authored-by: Ahtesham Quraish <ahtesham.quraish@192.168.1.6>
* add route for editing article drafts * restricted route, simplify * rename draftlisting page * invariant, use url funcs
OpenAPI ChangesShow/hide 11 changes: 0 error, 0 warning, 11 infoUnexpected changes? Ensure your branch is up-to-date with |
Comment on lines
+368
to
+371
| redis_cache = caches["redis"] | ||
| if not redis_cache.add( | ||
| cache_key, | ||
| True, # noqa: FBT003 |
There was a problem hiding this comment.
Bug: A cache key is set before enqueuing a task. If the task fails, the key blocks retries for 5 minutes, potentially causing missing content files.
Severity: MEDIUM
Suggested Fix
To ensure task failures don't block retries, consider moving the cache key logic. One approach is to set the cache key at the beginning of the Celery task itself, rather than before dispatching it. Alternatively, add a robust retry mechanism to the import_content_files task using Celery's autoretry_for decorator to handle transient failures gracefully.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: learning_resources/etl/loaders.py#L368-L371
Potential issue: The `enqueue_content_tasks` function sets a cache key using
`redis_cache.add()` before the `import_content_files` Celery task is enqueued. If this
task fails for any reason (e.g., worker crash), the cache key persists for its
300-second timeout. During this window, any subsequent calls to `enqueue_content_tasks`
for the same resource will find the key and return early, preventing a new task from
being queued. Since the task lacks an automatic retry policy, this can lead to content
files remaining missing for up to 5 minutes.
Did we get this right? 👍 / 👎 to inform future reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Chris Chudzicki
Ahtesham Quraish
Matt Bertrand
Tobias Macey
Carey P Gumaer
Jon Kafton
Nathan Levesque