This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new b20d56405a Review "Fix recovery after write failures in JULI
FileHandler"
b20d56405a is described below
commit b20d56405a981aea3b2205956130f2bc84ab7702
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Nov 6 15:04:23 2026 +0000
Review "Fix recovery after write failures in JULI FileHandler"
Fix a potential deadlock
---
java/org/apache/juli/FileHandler.java | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/java/org/apache/juli/FileHandler.java
b/java/org/apache/juli/FileHandler.java
index 5971e67aa9..44c41ecc04 100644
--- a/java/org/apache/juli/FileHandler.java
+++ b/java/org/apache/juli/FileHandler.java
@@ -239,6 +239,14 @@ public class FileHandler extends Handler {
tsDate = "";
}
+ String result;
+ try {
+ result = getFormatter().format(record);
+ } catch (Exception e) {
+ reportError(null, e, ErrorManager.FORMAT_FAILURE);
+ return;
+ }
+
writerLock.readLock().lock();
try {
// If the date has changed, switch log files
@@ -262,14 +270,6 @@ public class FileHandler extends Handler {
}
}
- String result;
- try {
- result = getFormatter().format(record);
- } catch (Exception e) {
- reportError(null, e, ErrorManager.FORMAT_FAILURE);
- return;
- }
-
try {
if (writer != null) {
writer.write(result);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]