Skip to content

Conversation

@MrCreosote
Copy link
Member

Currently, when running in callback server mode, if the JobRunner._submit method throws an error, the _watch loop will exit and the callback server will hang forever as the queues are no longer being serviced. This handles any _submit errors by putting an error back on the queue instead when running in callback server mode.

Currently, when running in callback server mode, if the
JobRunner._submit mode throws an error, the _watch loop will exit and
the callback server will hang forever as the queues are no longer being
serviced. This handles any _submit errors by putting an error back on
the queue instead when running in callback server mode.
@MrCreosote MrCreosote requested a review from bio-boris August 11, 2025 16:29
@MrCreosote
Copy link
Member Author

codacy is complaining about assert usage in tests

Accidentally left too much path in the path
@codecov
Copy link

codecov bot commented Aug 11, 2025

Codecov Report

❌ Patch coverage is 85.71429% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.95%. Comparing base (13ca137) to head (e8ed9cf).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
JobRunner/JobRunner.py 84.61% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #110      +/-   ##
==========================================
+ Coverage   80.55%   80.95%   +0.39%     
==========================================
  Files          13       13              
  Lines        1147     1155       +8     
==========================================
+ Hits          924      935      +11     
+ Misses        223      220       -3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@MrCreosote
Copy link
Member Author

Codacy is complaining about assert use in tests

@bio-boris bio-boris requested a review from Copilot August 11, 2025 16:48

This comment was marked as outdated.

"""

def __init__(self, config: Config, port=None):
def __init__(self, config: Config, port=None, server_mode: bool = False):
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be good to add info about what "Server Mode" means in the comment

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@bio-boris bio-boris requested a review from Copilot August 11, 2025 17:04
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a critical issue where the callback server would hang forever when an error occurred in the JobRunner._submit method. The fix ensures the callback server remains functional by handling submit errors gracefully when running in server mode.

Key changes:

  • Added error handling around the _submit method call to catch exceptions in callback server mode
  • Modified JobRunner constructor to accept a server_mode parameter to distinguish callback server operation
  • Added comprehensive test coverage for the error handling scenario

Reviewed Changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 2 comments.

File Description
JobRunner/JobRunner.py Added server_mode parameter and try-catch block around _submit calls to handle errors gracefully
JobRunner/Callback.py Updated to pass server_mode=True when creating JobRunner instances
test/test_callback_server_integration.py Added new test for submit failures and updated existing test parameters

inputs: config dictionary, EE2 URL, Job id, Token, Admin Token
Create the job runner.
cnnfig - the job runner config.
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

There is a typo in the parameter documentation. 'cnnfig' should be 'config'.

Suggested change
cnnfig - the job runner config.
config - the job runner config.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

j = resp.json()
assert "JobRunner/JobRunner/DockerRunner.py" in j["error"]["error"]
del j["error"]["error"]
assert j == {
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

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

There is an extra space between '==' and '{' in the assertion.

Suggested change
assert j == {
assert j == {

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@MrCreosote MrCreosote merged commit 8b7f6e2 into main Aug 11, 2025
11 of 12 checks passed
@bio-boris bio-boris mentioned this pull request Aug 15, 2025
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