AbstractHandler

  • init() always invokes doInit() and sets the state
  • destroy() checks the state and only invokes doDestroy() when initialized

There are race conditions in this code which were not fixed by simply making m_state volatile (stated as a solution here incorrectly).

The fact that this code is asymmetric is bad.

The contract for init() and destroy() is unclear:

  • Can you invoke init() multiple times?
  • Can you invoke init() .. destroy() .. init() in this order?

This obviously has to be aligned with the Servlet contract.

ServletHandlerRegistry

Creates lots of threads that asynchronously invoke life cycle methods in httpContextAdded, …Removed, addServletHandler, remove… which causes all kinds of interesting race conditions. I propose we remove all such threads and simply invoke the methods outside of the locked section

removeServletHandler even invokes destroy() on servletHandler both synchronously and asynchronously. Why?

addServletHandler, this does not work:

if (getLogService() != null) {
    getLogService().log(LogService.LOG_WARNING, …);

Whilst addServletHandler() throws an illegal state exception when it encounters a servlet handler that already exist while trying to add it, removeServletHandler() silently ignores the opposite situation.

Change By: Marcel Offermans (16/May/12 2:07 PM)
Resolution: Fixed
Status: Closed Reopened
Assignee: Matthijs Hendriks
Estimated Eng Workload: 1
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
Amdatu-developers mailing list
[email protected]
http://lists.amdatu.org/mailman/listinfo/amdatu-developers

Reply via email to