This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new 30791885d4 Review "Fix recovery after write failures in JULI
FileHandler"
30791885d4 is described below
commit 30791885d41415207e36102e61954f0d6f2266bf
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 b285ad5068..05936abb6b 100644
--- a/java/org/apache/juli/FileHandler.java
+++ b/java/org/apache/juli/FileHandler.java
@@ -241,6 +241,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
@@ -264,14 +272,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]