-
Notifications
You must be signed in to change notification settings - Fork 71
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
fix(clp-package): Remove faulty error handling for parsing archive compression stats. #640
Conversation
WalkthroughThe pull request introduces modifications to the Changes
Suggested Reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 0
🧹 Nitpick comments (1)
components/job-orchestration/job_orchestration/executor/compress/fs_compression_task.py (1)
248-252
: LGTM! The bug fix correctly handles subprocess output.The implementation now properly handles the subprocess output by correctly checking for EOF condition with
if not line
. This fixes the hanging issue mentioned in PR #634.Consider adding error handling for JSON decoding.
While the core bug is fixed, the JSON decoding could benefit from error handling to prevent crashes on malformed output.
Consider wrapping the JSON decoding in a try-except block:
if not line: last_line_decoded = True else: - stats = json.loads(line.decode("ascii")) + try: + stats = json.loads(line.decode("ascii")) + except json.JSONDecodeError as e: + logger.error(f"Failed to decode JSON from subprocess output: {e}") + stats = None
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
components/job-orchestration/job_orchestration/executor/compress/fs_compression_task.py
(1 hunks)
…mpression stats. (y-scope#640)
Description
Fix a bug introduced by #634.
The previous changed intended to catch empty strings (actually empty lines) in between the clp archive stat output, but made a few mistakes.
As a result, the change in #634 will cause the compression worker to stuck in the while-continue loop, causing compression job to hang.
For 3, since it will anyway be a non-empty line, and will be caught by Json decoding, we don;t need to specifically catch "\n" in our code. After all, CLP and CLP-S are not expected to behave in such way.
Validation performed
Manuall tested CLP and CLP-S compression job and make sure they don't hang.
Summary by CodeRabbit
Bug Fixes
New Features