Skip to content
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

don't use WARN log level when no policy is rolled back #1604

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

thjaeckle
Copy link
Member

I encountered a lot of "WARN" logs in the Ditto 3.2.0 release cause by the new "rollback policy on thing exception error during thing creation" stabilization done in #1581
I think a "WARNING" should only be logged if the policy is actually rolled back (deleted again).

Currently, it is always logged if e.g. the following 2 exception happen during thing creation:

  • ThingConflictException (thing already present) - nothing to roll back
  • ThingPreconditionFailedException - this is sent back when eg If-Match or If-None-Match headers were set to do a "conditional create" only if the thing does not yet exist

For those cases, I would not like to see a WARNING in the logs.
So I changed the log level to info instead and added another WARNING log when the policy is actually rolled back.

@alstanchev could you please have a look?

Signed-off-by: Thomas Jaeckle <thomas.jaeckle@beyonnex.io>
@thjaeckle thjaeckle added this to the 3.2.1 milestone Mar 22, 2023
@alstanchev
Copy link
Contributor

alstanchev commented Mar 22, 2023

I would even change them to debug and leave warn only if the policy is deleted but I will add it with a later commit when I finish with the caching problem. For now it LGTM:)

@thjaeckle thjaeckle merged commit 47064fb into master Mar 22, 2023
@thjaeckle thjaeckle deleted the bugfix/reduce-policy-rollback-warn-log branch March 22, 2023 22:09
@thjaeckle thjaeckle self-assigned this Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants