-
Notifications
You must be signed in to change notification settings - Fork 129
[Core] Fixed Pickle file load error #1909
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
base: main
Are you sure you want to change the base?
[Core] Fixed Pickle file load error #1909
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
…-causing-Pickle-load-error
…-causing-Pickle-load-error
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/16412632315/artifacts/3594599322Code Coverage Total Percentage:
|
…-causing-Pickle-load-error
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.
Pull Request Overview
This PR fixes pickle file deserialization errors that occur during resync operations in multiprocess mode by adding comprehensive error handling to the FileIPC class.
- Added robust exception handling for various pickle loading failures
- Enhanced error logging with fallback to default values when deserialization fails
- Added comprehensive test coverage for all error scenarios
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| port_ocean/utils/ipc.py | Enhanced pickle deserialization with comprehensive error handling and logging |
| port_ocean/tests/utils/test_ipc.py | Added extensive test suite covering all error scenarios for FileIPC |
| pyproject.toml | Version bump from 0.27.0 to 0.27.1 |
| CHANGELOG.md | Updated changelog to document the pickle error fix |
| [tool.poetry] | ||
| name = "port-ocean" | ||
| version = "0.27.0" | ||
| version = "0.27.1" |
Copilot
AI
Aug 6, 2025
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.
The version number in pyproject.toml (0.27.1) is inconsistent with the version mentioned in the PR description and CHANGELOG.md (0.25.4). This version mismatch could cause confusion and deployment issues.
| version = "0.27.1" | |
| version = "0.25.4" |
|
|
||
| <!-- towncrier release notes start --> | ||
|
|
||
| ## 0.27.1 (2025-08-06) |
Copilot
AI
Aug 6, 2025
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.
The version number in CHANGELOG.md (0.27.1) is inconsistent with the version mentioned in the PR description (0.25.4). This version mismatch could cause confusion and should be aligned with the actual version being released.
| ## 0.27.1 (2025-08-06) | |
| ## 0.25.4 (2025-08-06) |
Code Coverage Artifact 📈: https://github.com/port-labs/ocean/actions/runs/16777035921/artifacts/3700704135Code Coverage Total Percentage:
|
matan84
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.
requested change
| logger.warning( | ||
| f"Failed to load IPC data from {self.file_path}: {str(e)}. Returning default value." | ||
| ) | ||
| return self.default_return |
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.
Let's raise a more indicative error and not return the self.default_return here
User description
Description
What - Handles a deserialization error when loading an object from a pickle file during resync operations
Why -
How - I updated the deserialization logic to handle possible exceptions rather than interrupt resync
Type of change
Please leave one option from the following and delete the rest:
All tests should be run against the port production environment(using a testing org).
Core testing checklist
Integration testing checklist
examplesfolder in the integration directory.Preflight checklist
Screenshots
Include screenshots from your environment showing how the resources of the integration will look.
API Documentation
Provide links to the API documentation used for this integration.
PR Type
Bug fix
Description
Fixed pickle file deserialization errors in multiprocess mode
Added comprehensive error handling for corrupted pickle files
Enhanced IPC load method with fallback to default values
Added extensive test coverage for error scenarios
Changes diagram
Changes walkthrough 📝
ipc.py
Enhanced pickle deserialization with error handlingport_ocean/utils/ipc.py
pickle.load()in try-catch block for multiple error typesloguru.loggerfor error loggingtest_ipc.py
Added comprehensive FileIPC error handling testsport_ocean/tests/utils/test_ipc.py
CHANGELOG.md
Updated changelog for version 0.25.4CHANGELOG.md
pyproject.toml
Version bump to 0.25.4pyproject.toml