tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Costin Manolache <>
Subject Re: socket errors in catalina.out and mod_jk.log
Date Sat, 01 Mar 2003 04:34:42 GMT
Sven Köhler wrote:

>>>I took a short look at the ajp13 protocol draft, and the design of the
>>>protocol is really simple, too simple.
>> There are few knwon problems with the protocol - both sides of jk2 are
>> designed to support multiple protocols and extensions.
> yes, but how? how can either client or server guess, which extensions
> the other side supports?

By default - client and server assume the base protocol, ajp13.
You extend the server and the client by adding more components ( handlers,
etc). Then you configure those handlers.

Whoever configures the system is supposed to know what versions are
installed and what features he wants to use.

There is no reason to not add a "FeatureNegotiationHandler" and do whatever
complex thing you want. 

However there is a very simpler solution - both sides support JMX ( or the 
equivalent in C ). Listing all components is quite easy ( I already checked
in the proxy - so now all jk C components are visible in the JMX console ).
JMX is a registry for all the components, and each component supports a
certain API. 

If the other side doesn't support a feature - you'll just get an error,
which is the normal thing to happen. 

Can you be a bit more concrete and describe what exactly you want to do 
and can't because of the current architecture ? It is just a plain RPC
with some modifications for the part that is performance critical - any
handler you want can be implemented as a normal sync RPC call. I just can't
see what you would want to do and can't be done using normal and simple
RPC, but you could do with some complex negotiation.

>>>I can't see any possibility to send idle-packets to prevent a connection
>>>from timing out. That's a basic requirement, but it seems, that nobody
>>>thought of it. It also doens't include a "quit-command" (quits the
>> What prevents you from sending idle packets ? Or adding a quit command ?
> such are not part of ajp13, and adding them will surely brake
> compatibility to existing implementations as long as i can't determinte
> the supported features of the other side.

Yes - they are not part of ajp13. And yes - if you send those packets to 
an ajp13-only container, it'll not work. Think of Ajp13 request processing
as an interface - if you add more methods, you'll break existing
implementations. But that doesn't mean everything you want to do should 
be added to ajp13.

Don't confuse the Ajp13RequestProcessing API - the 3-4 messages that are 
used for sending request and response - with the whole jk2. It's just 
one interface. It is not concerned with discovery or anything else - just 
sending requests and receiving responses.

Besides - there is a huge number of features that could be implemented using
only the Ajp13RequestProcessing - just think about HTTP, which also has 
about 2-3 usefull messages ( 99% of the web uses GET and POST with one
header + body message in both sides ). On top of HTTP you can implement a
huge amount of features.

Do you want idle packets ? Send a AJP13 request to a URI "/_jk/idlePing". 
Want a quit ? Send a request to "/_jk/quit". Add whatever headers, user,
pass or other info you want. 

Both are reasonably easy to implement - the first will probably have less
overhead ( specialized packets ), the second will require the least amount
of work - and will be the easiest to maintain.

>> You can implement both - either with new packet types or by using
>> normal Ajp requests with some special URIs ( that will be handled by a jk
>> handler or even by a servlet ).
> same reason as above

What do you mean ? Make a AjpRequest to
"/_jk/ListAllTheBloatedFeaturesYouSupport" and you can get any answer you
want. Why would this discovery be part of the request/response processing ?

>> The protocol is a simple request/response - with apache initiating the
>> communication, and some twists to avoid some roundtrips. You can send any
>> type of packet - and do any kind of action.
> yes, but what will the other side do if it receives an unsupported
> package? it might drop a note to the log, and that would result in a
> log-flood again :-(

What will HTTP do if it receive an unuspported message ? Return an 
error and log a message. What should jk do ? 
Such mismatch happens only as a result of a config error - when you have 
a client asking for some unsupported server features.

If you implement the new message types as normal requests - you'll just 
get a 404 response code - and the normal access_log message.

>>>I cannot find a describtion of some kind of simple handshake in the
>>>draft i've found. so mod_jk is totally unaware of the server it's
>>>talking too.
>> Is there any handshake in the HTTP protocol ?
> You forget, that HTTP is designed, to be a temporal connection. Without
> keep-alive and such (which were added to HTTP1.0), a HTTP connection
> doesn't survive longer than one request.
> Sending headers and receiving them could also be interpreted, as a
> handshake.

And exactly the same "send headers and receive headers" is possible in
exactly same way in AJP. ( I'll not answer to the HTTP lesson, I think
most people on this list know about keep-alive and http versions )

>> Does anything in the current jk prevent you from adding any kind of
>> handshake you need ?
> umm ... yes?
> Adding new messages is a bad bad thing. I agree with Henri's opinion in
> this case. It's just a shame, that the protocol isn't designed to be
> extended without loosing compatibility.

The protocol _is_ designed to be extended, and you don't loose 
compatibility as long as you:
- use reqest/response
- configure correctly ( i.e. you don't enable a feature if you know the
other side doesn't support it )
- use any form of query - from just a list of mbeans/components to whatever
negotiation you want. 

>> There is one proposal ( made by Henri ) - that include capabilities
>> and version checking. I personally don't see the real need - in most
>> cases it is much easier to just configure this explicitely.
> So you really think, that many administrator cares about the
> documentation, or if they do understand it? You will have people mailing
> to the list, or just leaving the options "as is", so mod_jk wouldn't
> take advantage of the features with default configuration.

That's how the world is. If you don't know about a feature - most likely 
you won't use it. If you read the docs ( or ask ) - you may find out.

Nothing stops you from implementing jk components to do whatever discovery -
I just want to keep the base version simple enough, and avoid featurism
and bloat. 

>> Again - ajp13 defines a marshalling protocol and the 3-4 messages that
>> are needed for request processing. It is not an exclusive list - other
>> messages can be added.
> So where can i find the "final" draft or something, that explains all
> that stuff?
> After all you wrote, this draft should include a statement like
> "additional message-type that can be added, and should be silently
> ignored", so every conformant implementaion reacts the same way.

Probably searching the mailing lists archives is the only way to get 
good answers. Or you can write it yourself :-)

I think "silently ignoring" is a pretty bad choice.

Every use case I can think of can be covered with simple
request/response without any new message type. Henri is the only 
person who added new message types - and if I remember correctly he 
fixed both ends to deal with unknown messages. 

The only protocol change I would like to make is replacing the marshalling
with XDR ( that would require both ends to be explicitely configured ), and
adding a new message format to send requests without the ugly hack we do for
the POST body and with a simpler format. ( probably if we ever add XDR, this
can replace the request packet by default ).

>> In many cases simpler is better - HTTP is a very good proof of that.
>> I don't see any good reason to make the ajp13 protocol any more complex
>> than it is.
> proof?
> hmm ...
> - HTTP includes a version in each request and each response
> - a client does not know which features the server supports
> - => it blindly sends a request with a "let's see what happens" strategy
> - ...
> this should not apply for AJP13
> - the versions or feature information could be exchange at the start of
> the connection, a connection should remain for some amount of time
> - a client should know, if the server supports idle-message or
> quit-messages, the server should also know, which message the client may
> understand (for future enhancements and full compatibility)

I have to disagree. 

The wire protocol shouldn't care about hight level stuff. All the
negotiation and discovery can be done at a higher level. 

>> I am perfectly fine with adding other message types via plugins ( Jk
>> handlers and mod_jk components ), but the simple and stable base
>> protocol needs to remain stable.
> why should it get "unstable". how can a protocol get unstable?
> the protocol isself should be simple, and an implementaion shouldn't get
> to complicated (if we have to much additions, or even conflicting
> additions, it's time for a new protocol)

I think it's time for an old protocol :-) 

I am thinking to implement an XDR message format and the simplified request
- but I don't think it is a big priority. Jk supports multiple protocols
and I want to take advantage of it ( a lot of tools can talk XDR - python
has it buit-in for example ).


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message