ASF Bugzilla – Attachment 31827 Details for
Bug 56724
Restart Container background thread if it died unexpectedly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
2014-07-18_tc8_56724_v2.patch
2014-07-18_tc8_56724_v2.patch (text/plain), 2.92 KB, created by
Konstantin Kolinko
on 2014-07-17 22:55:24 UTC
(
hide
)
Description:
2014-07-18_tc8_56724_v2.patch
Filename:
MIME Type:
Creator:
Konstantin Kolinko
Created:
2014-07-17 22:55:24 UTC
Size:
2.92 KB
patch
obsolete
>Index: java/org/apache/catalina/core/ContainerBase.java >=================================================================== >--- java/org/apache/catalina/core/ContainerBase.java (revision 1611495) >+++ java/org/apache/catalina/core/ContainerBase.java (working copy) >@@ -1335,14 +1335,28 @@ > > @Override > public void run() { >- while (!threadDone) { >- try { >- Thread.sleep(backgroundProcessorDelay * 1000L); >- } catch (InterruptedException e) { >- // Ignore >+ Throwable t = null; >+ String unexpectedDeathMessage = sm.getString( >+ "containerBase.backgroundProcess.unexpectedThreadDeath", >+ Thread.currentThread().getName()); >+ try { >+ while (!threadDone) { >+ try { >+ Thread.sleep(backgroundProcessorDelay * 1000L); >+ } catch (InterruptedException e) { >+ // Ignore >+ } >+ if (!threadDone) { >+ processChildren(ContainerBase.this); >+ } > } >+ } catch (RuntimeException|Error e) { >+ t = e; >+ throw e; >+ } finally { >+ thread = null; > if (!threadDone) { >- processChildren(ContainerBase.this); >+ log.error(unexpectedDeathMessage, t); > } > } > } >Index: java/org/apache/catalina/core/LocalStrings.properties >=================================================================== >--- java/org/apache/catalina/core/LocalStrings.properties (revision 1611495) >+++ java/org/apache/catalina/core/LocalStrings.properties (working copy) >@@ -81,6 +81,7 @@ > containerBase.backgroundProcess.cluster=Exception processing cluster {0} background process > containerBase.backgroundProcess.realm=Exception processing realm {0} background process > containerBase.backgroundProcess.valve=Exception processing valve {0} background process >+containerBase.backgroundProcess.unexpectedThreadDeath=Unexpected death of background thread {0} > defaultInstanceManager.invalidInjection=Invalid method resource injection annotation > filterChain.filter=Filter execution threw an exception > filterChain.servlet=Servlet execution threw an exception >Index: webapps/docs/changelog.xml >=================================================================== >--- webapps/docs/changelog.xml (revision 1611495) >+++ webapps/docs/changelog.xml (working copy) >@@ -64,6 +64,10 @@ > <code>MapperListener</code> during repeated starts of embedded Tomcat. > (kkolinko) > </fix> >+ <add> >+ <bug>56724</bug>: Write an error message to Tomcat logs if container >+ background thread is aborted unexpectedly. (kkolinko) >+ </add> > </changelog> > </subsection> > <subsection name="Coyote">
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 56724
:
31813
| 31827