fix a STOPPED to ACTIVE issue by start method#7
fix a STOPPED to ACTIVE issue by start method#7383124397 wants to merge 1 commit intoapache:4.1.xfrom 383124397:4.1.x
Conversation
|
@383124397 Why do you want to restart a shut down |
|
@ok2c I mean there is no way to recover a stopped client if it was shut by a accident exception like seconds |
|
@383124397 I have never ever seen a complex system capable of recovering from OOM condition and I have seen a few. I personally would not attempt to recover a shut down client and would simply create a new one. |
|
@ok2c so the asynchttpclient is a one-off component for users, I hope it could be resiliently, high availability... and you know it could be caused memory leak if we create new client outside frequently. |
|
@383124397 Your own application causes OOM condition and you are worrying about resiliently and high availability of HttpAsyncClient? |
|
@ok2c I mean it's is good enough if the HttpAsyncClient can support be recovered from an exception scenario by invoke start method. |
|
@383124397 OOM in Java is considered a fatal error. If HttpAsycClient was unable to allocate some of its internal structures it may no longer be in a consistent state. This is the reason why it shuts down upon encountering OOM in the first place. It makes no sense to restart a shut down instance. It is much safer to create a new one. |
|
@383124397 Would you mind closing this PR? |
|
@ok2c OK |
We use httpasyncclient as our core async RPC component, but we found a recovering issue a couple days ago.
it is the async client will be stoped because of I/O reactor shutdown when a service encounter a OOM problem, a few seconds later and after a FGC process, the service has been recovered, but the async client cannot be recovered. so the client cannot accept the request unless the service need to reboot.
the code is:
or by close() method.
so there is no way to set status from STOPPED to ACTIVE even by start().