You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by "Hugh J. L." <hu...@yahoo.com> on 2002/09/18 04:12:58 UTC
Bug in DateTool in tomcat connector util?
Hi,
I found a bug (?) when i was testing tomcat3.3 using
MS web stress tool. I set up large amount of
concurrent requests for static files, each with header
If-Modified-Since which is newer than actual
last-modified-time of those requested files. I should
have got 304 response for ALL requests in this case,
however, i got many 304, a few 200, and even
NumberFormatException occasionally. This didn't happen
if i tested using only one client thread. I looked
into java.text.SimpleDateFormat and suspected it was
possibly a synchronization problem. Then I added
synchronization control to DateTool.parse(String,
DateFormat[]) as below and the problem was solved:
synchronized(format[i]) {
date = format[i].parse(dateString);
}
__________________________________________________
Do you Yahoo!?
Yahoo! News - Today's headlines
http://news.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Bug in DateTool in tomcat connector util?
Posted by Bill Barker <wb...@wilshire.com>.
----- Original Message -----
From: "Hugh J. L." <hu...@yahoo.com>
To: "Tomcat Developers List" <to...@jakarta.apache.org>
Sent: Thursday, September 19, 2002 12:03 AM
Subject: Re: Bug in DateTool in tomcat connector util?
> Just viewed DateTool in CVS. Yes, "format" also has
> thread problem and need fix. But, has "parse" been
> fixed? I didn't see any change about it in v1.7.
This was a pretty big change. It was reported as bugzilla #8562. Also see
o.a.t.core.Request[R1.115] and
o.a.t.modules.generators.StaticInterceptor[R1.23].
On the "parse" side, it uses the Thread-Local DateFormatters from the
Request to parse the date. Time permitting, I plan to eventually convert
the "format" side to use them as well.
>
> --- Bill Barker <wb...@wilshire.com> wrote:
> > I just checked in a fix for the "format" side
> > (setting the "Last-Modified"
> > header). This one is much harder to hit, but that
> > doesn't mean that you
> > can't. The "parse" side (getting the
> > "If-Modified-Since" header) has been
> > fixed in the nightly for quite some time now.
> >
> > ----- Original Message -----
> > From: "Hugh J. L." <hu...@yahoo.com>
> > To: "Tomcat Developers List"
> > <to...@jakarta.apache.org>
> > Sent: Tuesday, September 17, 2002 7:12 PM
> > Subject: Bug in DateTool in tomcat connector util?
> >
> >
> > > Hi,
> > >
> > > I found a bug (?) when i was testing tomcat3.3
> > using
> > > MS web stress tool. I set up large amount of
> > > concurrent requests for static files, each with
> > header
> > > If-Modified-Since which is newer than actual
> > > last-modified-time of those requested files. I
> > should
> > > have got 304 response for ALL requests in this
> > case,
> > > however, i got many 304, a few 200, and even
> > > NumberFormatException occasionally. This didn't
> > happen
> > > if i tested using only one client thread. I looked
> > > into java.text.SimpleDateFormat and suspected it
> > was
> > > possibly a synchronization problem. Then I added
> > > synchronization control to DateTool.parse(String,
> > > DateFormat[]) as below and the problem was solved:
> > >
> > > synchronized(format[i]) {
> > > date = format[i].parse(dateString);
> > > }
>
>
> __________________________________________________
> Do you Yahoo!?
> New DSL Internet Access from SBC & Yahoo!
> http://sbc.yahoo.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Bug in DateTool in tomcat connector util?
Posted by "Hugh J. L." <hu...@yahoo.com>.
Just viewed DateTool in CVS. Yes, "format" also has
thread problem and need fix. But, has "parse" been
fixed? I didn't see any change about it in v1.7.
--- Bill Barker <wb...@wilshire.com> wrote:
> I just checked in a fix for the "format" side
> (setting the "Last-Modified"
> header). This one is much harder to hit, but that
> doesn't mean that you
> can't. The "parse" side (getting the
> "If-Modified-Since" header) has been
> fixed in the nightly for quite some time now.
>
> ----- Original Message -----
> From: "Hugh J. L." <hu...@yahoo.com>
> To: "Tomcat Developers List"
> <to...@jakarta.apache.org>
> Sent: Tuesday, September 17, 2002 7:12 PM
> Subject: Bug in DateTool in tomcat connector util?
>
>
> > Hi,
> >
> > I found a bug (?) when i was testing tomcat3.3
> using
> > MS web stress tool. I set up large amount of
> > concurrent requests for static files, each with
> header
> > If-Modified-Since which is newer than actual
> > last-modified-time of those requested files. I
> should
> > have got 304 response for ALL requests in this
> case,
> > however, i got many 304, a few 200, and even
> > NumberFormatException occasionally. This didn't
> happen
> > if i tested using only one client thread. I looked
> > into java.text.SimpleDateFormat and suspected it
> was
> > possibly a synchronization problem. Then I added
> > synchronization control to DateTool.parse(String,
> > DateFormat[]) as below and the problem was solved:
> >
> > synchronized(format[i]) {
> > date = format[i].parse(dateString);
> > }
__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Bug in DateTool in tomcat connector util?
Posted by Bill Barker <wb...@wilshire.com>.
I just checked in a fix for the "format" side (setting the "Last-Modified"
header). This one is much harder to hit, but that doesn't mean that you
can't. The "parse" side (getting the "If-Modified-Since" header) has been
fixed in the nightly for quite some time now.
----- Original Message -----
From: "Hugh J. L." <hu...@yahoo.com>
To: "Tomcat Developers List" <to...@jakarta.apache.org>
Sent: Tuesday, September 17, 2002 7:12 PM
Subject: Bug in DateTool in tomcat connector util?
> Hi,
>
> I found a bug (?) when i was testing tomcat3.3 using
> MS web stress tool. I set up large amount of
> concurrent requests for static files, each with header
> If-Modified-Since which is newer than actual
> last-modified-time of those requested files. I should
> have got 304 response for ALL requests in this case,
> however, i got many 304, a few 200, and even
> NumberFormatException occasionally. This didn't happen
> if i tested using only one client thread. I looked
> into java.text.SimpleDateFormat and suspected it was
> possibly a synchronization problem. Then I added
> synchronization control to DateTool.parse(String,
> DateFormat[]) as below and the problem was solved:
>
> synchronized(format[i]) {
> date = format[i].parse(dateString);
> }
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! News - Today's headlines
> http://news.yahoo.com
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>