Skip to content

Conversation

@riya461
Copy link
Contributor

@riya461 riya461 commented Jan 9, 2026

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

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>
@riya461 riya461 changed the title Error log : SyncEventsFailure case Error log : SyncEventsFailure Jan 9, 2026
dataSyncCfg.getSyncTypeInStr();
if (!_ctx.stop_requested())
{
_ctx.spawn(_extDataIfaces->createErrorLog(
Copy link
Collaborator

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
Copy link
Collaborator

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()},
Copy link
Collaborator

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"}};
Copy link
Collaborator

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"] =
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants