-
Notifications
You must be signed in to change notification settings - Fork 0
Fix job deletion error handling with specific JobDeletedException #69
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
Conversation
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addressesI tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
nolan1999
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
poetry run ruff format --check . is failing. Please correct the formatting (you can run poetry run ruff format --fix . .
Co-authored-by: nolan1999 <54246789+nolan1999@users.noreply.github.com>
Co-authored-by: nolan1999 <54246789+nolan1999@users.noreply.github.com>
Co-authored-by: nolan1999 <54246789+nolan1999@users.noreply.github.com>
…ary tests Co-authored-by: nolan1999 <54246789+nolan1999@users.noreply.github.com>
…test_job_tracking.py Co-authored-by: nolan1999 <54246789+nolan1999@users.noreply.github.com>
Co-authored-by: nolan1999 <54246789+nolan1999@users.noreply.github.com>
Co-authored-by: nolan1999 <54246789+nolan1999@users.noreply.github.com>
c44daf2 to
f50b3ad
Compare
Problem
The system was using generic
ValueErrorto signal job deletion in the user-facing API, which is too generic and might hide other errors. Additionally,RDSJobQueue.handle_timeoutswas not handling deletion errors gracefully, causing crashes when jobs were deleted by users.Solution
This PR introduces a specific
JobDeletedExceptionfor job deletion scenarios and updates all relevant code to handle it gracefully.Key Changes
New Exception Class: Created
JobDeletedExceptioninworkerfacing_api/exceptions.pywith job ID tracking and descriptive error messages.Updated Error Handling:
job_tracking.update_jobnow raisesJobDeletedExceptioninstead ofValueErroron 404 responsesRDSJobQueue._update_job_statuscatches and re-raises the specific exceptionRDSJobQueue.handle_timeoutsgracefully handles deletion errors by skipping status updatesRDSJobQueue.popgracefully handles deletion errors by returning FalseImproved Robustness: The timeout handling mechanism now continues processing other jobs even when some jobs are deleted, preventing system crashes.
Example
Before:
After:
Testing
This change improves error specificity and system reliability while maintaining backward compatibility.
Fixes #67.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
cognito-idp.eu-central-1.amazonaws.com/home/REDACTED/work/DECODE_Cloud_WorkerAPI/DECODE_Cloud_WorkerAPI/.venv/bin/python -m pytest tests/integration/endpoints/test_jobs.py::TestJobs::test_put_job_status_canceled -v(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.