[ 
https://issues.apache.org/jira/browse/HTTPCORE-127?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12550959
 ] 

Oleg Kalnichevski commented on HTTPCORE-127:
--------------------------------------------

Hi Asankha, 

I have just one minor gripe with the patch. Do we really need to expose 
ServerSocketChannel in the public API? I am feeling a bit uneasy about this 
because this makes it very easy to abuse the API. One can easily get hold of 
the underlying socket and mess things up pretty badly.

The #shutdown() method performs a graceful shutdown of connections in the sense 
that it allows the connection to take its time to flush buffered data and to 
terminate connections orderly using proper handshaking if required. This is 
primarily intended for SSL connections, as SSL employs some sort of a shutdown 
handshake to cleanly terminate active connections. 

If what you want is to let the I/O reactor finish all active requests and only 
then shut it down, then you probably need to move control logic to the protocol 
handler level. You need to (1) pause the I/O reactor (2) instruct the protocol 
handler to finish processing the active request and to close connection 
immediately after (3) wait until all connections are gone (4) shutdown the I/O 
reactor.

Oleg

> Expose improved API for lifecycle management
> --------------------------------------------
>
>                 Key: HTTPCORE-127
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-127
>             Project: HttpComponents Core
>          Issue Type: Improvement
>          Components: HttpCore NIO
>    Affects Versions: 4.0-alpha6
>            Reporter: Asankha C. Perera
>             Fix For: 4.0-beta1
>
>         Attachments: httpcore-127.patch
>
>
> Apache Synapse uses HttpCore and we would like to stop accepting new 
> connections to put our servers into a "maintenance" mode. In this mode any 
> in-flight requests already being served will continue as normal (i.e. 
> reading, writing etc) but new connections should be rejected, so that a load 
> balancer could direct new connections to another instance in the cluster. The 
> requirement is to then update configuration, apply patches or cleanly 
> shutdown etc. for maintenance without effecting any in-flight requests.
> Implementation wise I think this would be fairly straightforward as we can 
> remove OP_ACCEPT from the interested ops.
> On the mailing list Odi suggested that we tackle this at a broader level by 
> exposing lifecycle management APIs
> "I suggest create, start, stop, destroy methods in some classes/APIs 
> (semantics of JBoss Service MBeans)"

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to