-
Notifications
You must be signed in to change notification settings - Fork 6
Error log : SyncEventsFailure #86
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?
Conversation
An Event Failure error log creation happens when the data watcher cannot be created for a path in immediate sync. Since the error log creation is within an exception, it is spawned. When the above logic is added, it fails some Unit Test cases. On debugging observed the below flow causing the failure: The ctx is stopped to exit from the loop on watching the data paths. This will fail the syncData spawning throwing an error. Before, this error was caught in exception and gracefully exited. But now in addition to this, an error log is being created for which we need ctx. This causes a runtime error resulting in UT failure. To solve this, a check is added for `ctx.stop_requested` before spawning error log creation. Change-Id: Ie7a98e933003a095dffd414826072d8866e61276 Signed-off-by: Riya Sabu <riya.sabu461@gmail.com>
| dataSyncCfg.getSyncTypeInStr(); | ||
| if (!_ctx.stop_requested()) | ||
| { | ||
| _ctx.spawn(_extDataIfaces->createErrorLog( |
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 think we discussed to use co_await with scope_fail, right?
| "{ERROR}", | ||
| "PATH", dataSyncCfg._path, "ERROR", e.what()); | ||
|
|
||
| // Error log if fails to create watcher for a |
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 feel, these comment is unnecessary. The function name itself explains it.
| // Error log if fails to create watcher for a | ||
| // file/directory. | ||
| ext_data::AdditionalData additionalDetails = { | ||
| {"DS_Sync_Event_Path", dataSyncCfg._path.string()}, |
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.
DS_Sync_Event_Path
DS_Sync_Path?
| // file/directory. | ||
| ext_data::AdditionalData additionalDetails = { | ||
| {"DS_Sync_Event_Path", dataSyncCfg._path.string()}, | ||
| {"DS_Sync_Event_Msg", "Failed to create watcher for the path"}}; |
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.
DS_Sync_ErrMsg?
| ext_data::AdditionalData additionalDetails = { | ||
| {"DS_Sync_Event_Path", dataSyncCfg._path.string()}, | ||
| {"DS_Sync_Event_Msg", "Failed to create watcher for the path"}}; | ||
| additionalDetails["DS_Sync_Event_Type"] = |
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.
DS_Sync_Event_Type
DS_Sync_Type?
An Event Failure error log creation happens when
the data watcher cannot be created for a path in immediate sync.
Since the error log creation is within an exception, it is spawned. When the above logic is added, it fails some Unit Test cases.
On debugging observed the below flow causing the failure: The ctx is stopped to exit from the loop on watching the data paths. This will fail the syncData spawning throwing an error.
Before, this error was caught in exception and gracefully exited. But now in addition to this, an error log is being created for which we need ctx.
This causes a runtime error resulting in UT failure.
To solve this, a check is added for
ctx.stop_requestedbefore spawning error log creation.Change-Id: Ie7a98e933003a095dffd414826072d8866e61276