-
Notifications
You must be signed in to change notification settings - Fork 6
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: gracefully continue on tempfile cleanup failure #103
fix: gracefully continue on tempfile cleanup failure #103
Conversation
📝 Walkthrough📝 WalkthroughWalkthroughThe changes in this pull request involve modifications to the Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AirbyteEntrypoint
participant TemporaryDirectory
participant MessageValidator
User->>AirbyteEntrypoint: Execute command (spec/check/discover/read)
AirbyteEntrypoint->>TemporaryDirectory: Create temporary directory (ignore_cleanup_errors=True)
TemporaryDirectory-->>AirbyteEntrypoint: Directory created
AirbyteEntrypoint->>MessageValidator: Validate message attributes
alt Missing Attributes
MessageValidator-->>AirbyteEntrypoint: Raise ValueError
else Valid Attributes
MessageValidator-->>AirbyteEntrypoint: Process message
end
AirbyteEntrypoint->>User: Return result
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
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
🧹 Outside diff range and nitpick comments (2)
airbyte_cdk/entrypoint.py (2)
132-136
: LGTM! Consider adding debug logging for cleanup failures?The change to ignore cleanup errors is a good defensive programming approach. What do you think about adding debug logging when cleanup fails? This could help with debugging if needed, wdyt?
with tempfile.TemporaryDirectory( # Cleanup can fail on Windows due to file locks. Ignore if so, # rather than failing the whole process. - ignore_cleanup_errors=True, + ignore_cleanup_errors=True, + # Using a lambda to avoid string formatting overhead when debug logging is disabled + onerror=lambda func, path, exc_info: logger.debug(f"Ignored cleanup error for {path}: {exc_info[1]}") ) as temp_dir:
133-134
: Would you mind expanding the comment about Windows file locks?The comment is helpful but could be more specific about which Windows scenarios can cause file locks (e.g., open file handles, antivirus scanning). This would help future maintainers understand the exact use cases this handles, wdyt?
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
airbyte_cdk/entrypoint.py
(1 hunks)unit_tests/sources/streams/test_call_rate.py
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- unit_tests/sources/streams/test_call_rate.py
Resolves: airbytehq/PyAirbyte#424
Replaces:
Summary by CodeRabbit
New Features
Bug Fixes
Tests