Skip to content

refactor: Handle no entities found gracefully in event cleanup#5322

Merged
judehung merged 1 commit intoedgexfoundry:mainfrom
FelixTing:issue-5319
Dec 2, 2025
Merged

refactor: Handle no entities found gracefully in event cleanup#5322
judehung merged 1 commit intoedgexfoundry:mainfrom
FelixTing:issue-5319

Conversation

@FelixTing
Copy link
Member

fix: #5319

PR Checklist

Please check if your PR fulfills the following requirements:

  • I am not introducing a breaking change (if you are, flag in conventional commit message with BREAKING CHANGE: describing the break)
  • I am not introducing a new dependency (add notes below if you are)
  • I have added unit tests for the new feature or bug fix (if not, why?)
  • I have fully tested (add details below) this the new feature or bug fix (if not, why?)
  • I have opened a PR for the related docs change (if not, why?)

Testing Instructions

New Dependency Instructions (If applicable)

@FelixTing FelixTing requested a review from judehung November 28, 2025 00:12
Copy link
Member

@judehung judehung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you intentionally use semicolon instead of colon in the debug log?

- Change deleteReadingsBySubQuery and deleteEvents to return KindEntityDoesNotExist
  instead of KindContractInvalid when no rows are found
- Include SQL statement in error messages for debugging
- Log KindEntityDoesNotExist error at debug level

Signed-off-by: FelixTing <felix@iotechsys.com>
@sonarqubecloud
Copy link

Copy link
Member

@judehung judehung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@judehung judehung merged commit 3c19b64 into edgexfoundry:main Dec 2, 2025
7 checks passed
@FelixTing FelixTing deleted the issue-5319 branch December 2, 2025 03:10
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.

Handle missing readings/events gracefully in event retention

2 participants