This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 6823bcc8ef Review "Fix recovery after write failures in JULI
FileHandler"
6823bcc8ef is described below
commit 6823bcc8ef68a2379cb7a9b72c51b2bd6903c49d
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 2bc787e4d0..a08ccbfd41 100644
--- a/java/org/apache/juli/FileHandler.java
+++ b/java/org/apache/juli/FileHandler.java
@@ -237,6 +237,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
@@ -260,14 +268,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]