feat: utility function to persist critical error#222
Conversation
Signed-off-by: adarsh0728 <gooneriitk@gmail.com>
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 <gooneriitk@gmail.com>
Signed-off-by: adarsh0728 <gooneriitk@gmail.com>
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 StructureCode 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.
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.
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.
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
Signed-off-by: adarsh0728 <gooneriitk@gmail.com>
Signed-off-by: adarsh0728 <gooneriitk@gmail.com>
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