-
Notifications
You must be signed in to change notification settings - Fork 24
feat: utility function to persist critical error #222
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
Signed-off-by: adarsh0728 <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #222 +/- ##
==========================================
- Coverage 94.20% 94.19% -0.01%
==========================================
Files 55 58 +3
Lines 2311 2359 +48
Branches 119 119
==========================================
+ Hits 2177 2222 +45
- Misses 97 100 +3
Partials 37 37 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: adarsh0728 <[email protected]>
Signed-off-by: adarsh0728 <[email protected]>
TestingOnly one file created when multiple threads called
|
@adarsh0728 This is good to review? |
yes, please. |
@adarsh0728 Could you please verify the functionality with an async example as well? That would be helpful |
Testing Async Sink exampleError persisted only once.
File Structure
Code Change in
|
error_code = error_code or INTERNAL_ERROR | ||
current_timestamp = int(time.time()) | ||
|
||
runtime_error_entry = _RuntimeErrorEntry( |
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.
I see we use this only for runtime_error_entry.to_dict()
Do we need a separate class declaration for this?
Is it expected to be used anywhere else as well?
We can directly create an inline dict object
runtime_error = {
"container": CONTAINER_TYPE,
"timestamp": current_timestamp,
"code": error_code,
"message": error_message,
"details": error_details,
}
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.
In future, it can be used to persist other errors, format would remain same. Also, we want to remain consistent across SDK's to have a separate class for RuntimeErrorEntry.
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.
In that case if you wish to keep this around. Can we convert this to a data class if this is the current use case
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.
done
Signed-off-by: adarsh0728 <[email protected]>
Signed-off-by: adarsh0728 <[email protected]>
Signed-off-by: adarsh0728 <[email protected]>
Refer numaproj/numaflow#2479
A new errors pkg with PersistCriticalError functionality for the user to persist a critical error and ultimately view it in the UI.
Go SDK PR numaproj/numaflow-go#189
Java SDK PR numaproj/numaflow-java#178