Re: (tomcat) 05/05: Need for force GC to avoid duplicate clean-up (which triggers a crash)

2024-02-12 Thread Christopher Schultz

Mark,

On 2/8/24 16:18, ma...@apache.org wrote:

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 967be0a2d5bb90a5f962359e80fe3e6a78b1ea51
Author: Mark Thomas 
AuthorDate: Thu Feb 8 21:17:24 2024 +

 Need for force GC to avoid duplicate clean-up (which triggers a crash)
---
  java/org/apache/catalina/core/AprLifecycleListener.java | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/java/org/apache/catalina/core/AprLifecycleListener.java 
b/java/org/apache/catalina/core/AprLifecycleListener.java
index da2c0e3862..974af71ba2 100644
--- a/java/org/apache/catalina/core/AprLifecycleListener.java
+++ b/java/org/apache/catalina/core/AprLifecycleListener.java
@@ -170,6 +170,8 @@ public class AprLifecycleListener implements 
LifecycleListener {
  
  private static void terminateAPR() {

  Library.terminatePrepare();
+// Need to force GC here as some components do APR clean-up in 
finalize()
+System.gc();
  AprStatus.setAprInitialized(false);
  AprStatus.setAprAvailable(false);
  fipsModeActive = false;


I'm sure you we thinking "eew gross" when you wrote this.

Is there no other way to do this with volatile flags and 
intentional-cleanup rather than ugly finalizer-based cleanup?


-chris

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 05/05: Need for force GC to avoid duplicate clean-up (which triggers a crash)

2024-02-08 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 4471b2a54975a7afc79cfbd33387f7f19f45df07
Author: Mark Thomas 
AuthorDate: Thu Feb 8 21:17:24 2024 +

Need for force GC to avoid duplicate clean-up (which triggers a crash)
---
 java/org/apache/catalina/core/AprLifecycleListener.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/java/org/apache/catalina/core/AprLifecycleListener.java 
b/java/org/apache/catalina/core/AprLifecycleListener.java
index 28bdee051b..ffcc694e6f 100644
--- a/java/org/apache/catalina/core/AprLifecycleListener.java
+++ b/java/org/apache/catalina/core/AprLifecycleListener.java
@@ -176,6 +176,8 @@ public class AprLifecycleListener implements 
LifecycleListener {
 
 private static void terminateAPR() {
 Library.terminatePrepare();
+// Need to force GC here as some components do APR clean-up in 
finalize()
+System.gc();
 aprInitialized = false;
 aprAvailable = false;
 fipsModeActive = false;


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



(tomcat) 05/05: Need for force GC to avoid duplicate clean-up (which triggers a crash)

2024-02-08 Thread markt
This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 967be0a2d5bb90a5f962359e80fe3e6a78b1ea51
Author: Mark Thomas 
AuthorDate: Thu Feb 8 21:17:24 2024 +

Need for force GC to avoid duplicate clean-up (which triggers a crash)
---
 java/org/apache/catalina/core/AprLifecycleListener.java | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/java/org/apache/catalina/core/AprLifecycleListener.java 
b/java/org/apache/catalina/core/AprLifecycleListener.java
index da2c0e3862..974af71ba2 100644
--- a/java/org/apache/catalina/core/AprLifecycleListener.java
+++ b/java/org/apache/catalina/core/AprLifecycleListener.java
@@ -170,6 +170,8 @@ public class AprLifecycleListener implements 
LifecycleListener {
 
 private static void terminateAPR() {
 Library.terminatePrepare();
+// Need to force GC here as some components do APR clean-up in 
finalize()
+System.gc();
 AprStatus.setAprInitialized(false);
 AprStatus.setAprAvailable(false);
 fipsModeActive = false;


-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org