https://issues.apache.org/bugzilla/show_bug.cgi?id=47655

--- Comment #9 from Konstantin Kolinko <knst.koli...@gmail.com> 2010-02-02 
22:25:48 UTC ---
Looking at all the three stack traces (from the Description and Comment 1,
Comment 2), all of them occur only if in MimeHeaders class methods headers[i]
occurs to be null.

That is particularly visible from the third stack trace, that points to 
org.apache.tomcat.util.http.MimeHeaders.clear(MimeHeaders.java:130)

MimeHeaders.headers[i] equal to null can be only if MimeHeaders.count has a
wrong value, or if a new MimeHeaderField was assigned to a wrong cell in the
array, or to a wrong array when the array was expanded. That can only occur if
MimeHeaders.createHeader() or MimeHeaders.removeHeader(int) were called
concurrently by multiple threads.


MimeHeaders class is not safe for multithreading. Therefore
response.setHeader(...), response.addHeader(...) methods are not thread-safe.

Thus, if several threads add/set headers asynchronously, you will see this
error.

This behavior conforms to the specification - see chapter SRV.2.3.3.3 in Java
Servlet Specification 2.5.  It says "Implementations of the request and
response objects are not guaranteed to be thread safe."

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

Reply via email to