Brian Parkinson wrote:
Hello:
I have a question about mina - wondering if someone out there has a couple
minutes to help out:
I have a server running mina-2.0.0M1 (which is pretty old) which opens both a
non-SSL and SSL ports. There are two issues I'm seeing in production - I'm not
sure that this is mina related - still investigating, but right now, it looks
to be comms related.
1. Every 4 days or so (so far, can't correlate to anything) the server "locks
up" and refuses all subsequent requests (?). Trying to narrow down, I have been
informed that there may be an issue with mina-core-2.0.0M1, and I should upgrade to
mina-core-2.0.0M6. I've done this - the compile was pretty straightforward. The init code
is attached below - does this look correct - just want to make sure that I'm not doing
something wrong which might cause resources to leak over time.
Seems ok to me.
2. I've noticed one recurring error in my log files - in my HttpRequestDecoder (extends
MessageDecoderAdapter), I am throwing an exception trying to parse up the headers - the code ends
up getting "partial line" headers (for example, the decoder attempts to parse a line
"Content-Ty" with nothing else on the line) - it seems like the HTTP packet is not
complete - should I be concerned about this? An exception is thrown, and the caller will re-send
anyways, but the error is seen a fair bit throughout the logs, and I'm wondering if this might be
contributing to the lock up issue (?).
You have no guarantee that the messages sent by a client will be
received fully. They can even been sent one byte at a time. It's up to
you to gather all the incoming bytes until you have enough bytes to
decode your protocol. In your case, however, you can use the
TextLineDecoder which waits for a line feed to forward the decoded
message to your handler.
I think it's described on the sparse doco...
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org