Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0002870 [Resin] minor always 08-26-08 08:30 09-04-08 14:09
Reporter ferg View Status public  
Assigned To ferg
Priority normal Resolution fixed  
Status closed   Product Version 3.2.1
Summary 0002870: comet w/o skip
Description (rep by David Peterson)

Not sure if this is a bug or a feature-request, so
thought I'd start with the support channel.

I'm looking into different ways to delay processing
of a servlet request without tying up Resin's worker
threads. The comet/server-push additions seem
tantalizingly close to something we could use but
there is a one big show-stopper.

It appears that after CometServlet.service() is
called and after each call to CometServlet.resume()
(and at least one other time that I'm not sure
about) the server calls
AbstractHttpResponse.finish(), which in turn calls
AbstractHttpRequest.skip(). And the "skip" part is
the real problem for us.

We want to defer processing of the entire request -
we could use service() to figure out when to handle
the request and then schedule a later call to
resume(). But to do so with the current
implementation we would have to read the entire
request body prior to exiting servce() or else we
lose any posted data. We'd like to just leave the
request body buffered "on the wire" and pull the
data off when the request is serviced.

The attached servlet has a bare-bones example of
what I'm talking about. If a "delay" parameter is
passed to the request then when resume() is called
there is no data to be read off the wire. I have
been using curl to post the data like this:

curl --data-binary @random -H

http://localhost:8080/resin-doc/examples/servlet-comet/delayed-comet?delay=10 [^]

where "random" is just a local file filled with
garbage binary data (dd if=/dev/urandom of=random
bs=1M count=1)

Would it be possible (without breaking something
else) to check the connection and/or controller
status in finish() and not call skip()?

Additional Information
Attached Files  AbstractHttpRequest.patch [^] (1,048 bytes) 08-26-08 09:56

- Relationships

- Notes
08-26-08 09:57

I made the change in the attached patch, and things seem to work in my limited testing, but who knows what I may have broken.
09-04-08 14:09


- Issue History
Date Modified Username Field Change
08-26-08 08:30 ferg New Issue
08-26-08 09:56 david-peterson File Added: AbstractHttpRequest.patch
08-26-08 09:57 david-peterson Note Added: 0003360
09-04-08 14:09 ferg Note Added: 0003387
09-04-08 14:09 ferg Assigned To  => ferg
09-04-08 14:09 ferg Status new => closed
09-04-08 14:09 ferg Resolution open => fixed
09-04-08 14:09 ferg Fixed in Version  => 3.2.1

Mantis 1.0.0rc3[^]
Copyright © 2000 - 2005 Mantis Group
32 total queries executed.
27 unique queries executed.
Powered by Mantis Bugtracker