Rethrow Error during retrieving remoteAddress / localAddress
Motivation: Besides an error caused by closing socket in Windows a bunch of other errors may happen at this place which won't be somehow logged. For instance any VirtualMachineError as OutOfMemoryError will be simply ignored. The library should at least log the problem. Modification: Added logging of the throwable object. Result: Fixes #8499.
This commit is contained in:
parent
cb0d23923f
commit
abc8a08c96
@ -170,6 +170,8 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
||||
if (localAddress == null) {
|
||||
try {
|
||||
this.localAddress = localAddress = unsafe().localAddress();
|
||||
} catch (Error e) {
|
||||
throw e;
|
||||
} catch (Throwable t) {
|
||||
// Sometimes fails on a closed socket in Windows.
|
||||
return null;
|
||||
@ -192,6 +194,8 @@ public abstract class AbstractChannel extends DefaultAttributeMap implements Cha
|
||||
if (remoteAddress == null) {
|
||||
try {
|
||||
this.remoteAddress = remoteAddress = unsafe().remoteAddress();
|
||||
} catch (Error e) {
|
||||
throw e;
|
||||
} catch (Throwable t) {
|
||||
// Sometimes fails on a closed socket in Windows.
|
||||
return null;
|
||||
|
Loading…
Reference in New Issue
Block a user