SEZ9 commented on PR #11984:
URL: https://github.com/apache/seatunnel/pull/11984#issuecomment-5433995073

   Thanks for the review — both points were fair, and both are fixed.
   
   **`previousLevel` was read outside the mutation.** `LoggerLevelService` read 
the effective level and
   then called `LogLevels.apply`/`reset`, so two concurrent requests for the 
same logger could both
   report the same `previousLevel`. The capture moved inside `LogLevels`, under 
the same monitor as the
   mutation: `apply` now returns the level it replaced, and `reset` returns a 
small `Reverted` value
   (`isReverted`, `previousLevel`, `level`) instead of a boolean, so the 
before/after pair is taken
   atomically. The remaining read-after-change race is for the 
`origin`/`fileLevel` fields that are read
   back after the change to build the response — that one is inherent to 
reporting log4j2 state through
   a REST response and is documented rather than locked, since the alternative 
is holding the monitor
   across response building.
   
   **`errorMessage` could return `null`.** It used `t.getMessage()`, which is 
`null` for exceptions like
   `NullPointerException` thrown without a message, so the response could carry 
a `null` message. It now
   unwraps to the root cause (guarding against a self-referencing cause) and 
falls back to the class name
   when the message is `null`, so the field is always populated with something 
actionable.
   
   The `doris-connector-it` / `all-connectors-it-2` failures are unrelated to 
this change — this PR only
   touches `seatunnel-engine-server` log-level code, the `/loggers` servlet 
plane and docs; no connector
   code is in the diff.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to