You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "dsoumis (via GitHub)" <gi...@apache.org> on 2026/04/21 20:51:33 UTC
[PR] Fix race condition in StandardContext.getServletContext() [tomcat]
dsoumis opened a new pull request, #994:
URL: https://github.com/apache/tomcat/pull/994
The context field was not volatile and getServletContext()was not synchronized, allowing concurrent threads to create competing ApplicationContext instances during reload. This could cause the TEMPDIR servlet context attribute to be permanently lost.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: [PR] Fix race condition in StandardContext.getServletContext() [tomcat]
Posted by Christopher Schultz <ch...@christopherschultz.net>.
Dimitris,
Oh, wow. I think I may have seen this in the wild just recently.
-chris
On 4/21/26 4:51 PM, dsoumis (via GitHub) wrote:
>
> dsoumis opened a new pull request, #994:
> URL: https://github.com/apache/tomcat/pull/994
>
> The context field was not volatile and getServletContext()was not synchronized, allowing concurrent threads to create competing ApplicationContext instances during reload. This could cause the TEMPDIR servlet context attribute to be permanently lost.
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: [PR] Fix race condition in StandardContext.getServletContext() [tomcat]
Posted by "dsoumis (via GitHub)" <gi...@apache.org>.
dsoumis merged PR #994:
URL: https://github.com/apache/tomcat/pull/994
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: [PR] Fix race condition in StandardContext.getServletContext() [tomcat]
Posted by "rmaucher (via GitHub)" <gi...@apache.org>.
rmaucher commented on PR #994:
URL: https://github.com/apache/tomcat/pull/994#issuecomment-4291770340
Ok, I think it makes sense. No need to add weird tests after fixing though, you might as well testing the pattern itself in a generic way at some point.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
Re: [PR] Fix race condition in StandardContext.getServletContext() [tomcat]
Posted by "dsoumis (via GitHub)" <gi...@apache.org>.
dsoumis commented on PR #994:
URL: https://github.com/apache/tomcat/pull/994#issuecomment-4294709387
I think the test adds value to the commit as it acts both as a reproducer and as a resource for anyone inspecting the commit to seamlessly understand what was wrong and fixed. I would keep it if no objections.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org