axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 9817] New: - Race condition exists in AxisServlet
Date Wed, 12 Jun 2002 20:20:36 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9817>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=9817

Race condition exists in AxisServlet

           Summary: Race condition exists in AxisServlet
           Product: Axis
           Version: beta-2
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Basic Architecture
        AssignedTo: axis-dev@xml.apache.org
        ReportedBy: joe.riess@lexisnexis.com


A slight race condition exists in the AxisServlet::doPost() method which allows 
two servlet threads to create separate instances of the AxisEngine.  Here's a 
code snippet:

    public void doPost(HttpServletRequest req, HttpServletResponse res)
        throws ServletException, IOException {
        if(isDebug) log.debug("In doPost");
        if (engine == null) {
            try {
                engine = getEngine();
            } catch (AxisFault fault) {
                log.error(JavaUtils.getMessage("axisFault00"), fault);
                Message msg = new Message(fault);
                res.setContentType( msg.getContentType() );
                res.setContentLength( msg.getContentLength() );
                msg.writeContentToStream(res.getOutputStream());
                return;
            }
        }

It's possible (I verified this) for two seperate threads to enter the try 
block.  If this occurs, two instances of the AxisEngine will be created, with 
only the second instance actually remaining available for subsequent requests.

Mime
View raw message