mirror of https://github.com/halo-dev/halo
Change log level to warn for optimistic locking failure error (#2957)
#### What type of PR is this? /kind improvement #### What this PR does / why we need it: /kind api-change #### Which issue(s) this PR fixes: Fixes #2591 #### Special notes for your reviewer: #### Does this PR introduce a user-facing change? ```release-note NONE ```pull/2962/merge
parent
c90f19211f
commit
64550d235f
|
@ -11,6 +11,7 @@ import java.util.function.Supplier;
|
||||||
import java.util.stream.IntStream;
|
import java.util.stream.IntStream;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
|
import org.apache.commons.lang3.concurrent.BasicThreadFactory;
|
||||||
|
import org.springframework.dao.OptimisticLockingFailureException;
|
||||||
import org.springframework.lang.Nullable;
|
import org.springframework.lang.Nullable;
|
||||||
import org.springframework.util.Assert;
|
import org.springframework.util.Assert;
|
||||||
import org.springframework.util.StopWatch;
|
import org.springframework.util.StopWatch;
|
||||||
|
@ -167,9 +168,14 @@ public class DefaultController<R> implements Controller {
|
||||||
log.trace(watch.toString());
|
log.trace(watch.toString());
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
log.error("Reconciler in " + this.name
|
if (t instanceof OptimisticLockingFailureException) {
|
||||||
+ " aborted with an error, re-enqueuing...",
|
log.warn("Optimistic locking failure when reconciling request: {}/{}",
|
||||||
t);
|
this.name, entry.getEntry());
|
||||||
|
} else {
|
||||||
|
log.error("Reconciler in " + this.name
|
||||||
|
+ " aborted with an error, re-enqueuing...",
|
||||||
|
t);
|
||||||
|
}
|
||||||
result = new Reconciler.Result(true, null);
|
result = new Reconciler.Result(true, null);
|
||||||
} finally {
|
} finally {
|
||||||
queue.done(entry.getEntry());
|
queue.done(entry.getEntry());
|
||||||
|
|
Loading…
Reference in New Issue