- Steps to reproduce:
run this code
with this config
where 192.168.12.8 is a host that actually exist (it can be pinged), but nothing is listening on this port.
(for some reason I don't completely understand, the host must not be localhost; otherwise we correctly get the expected behavior)
- Expected result:
- log4j2 gives up trying to connect to the server after the specified timeout (here: 100ms)
- the program prints "Done" on the console, and exits
- Actual result: the program doesn't print anything, and hangs forever.
A thread dump shows
- potential fix:
With the following patch, I get the expected result, along with a logged "Error writing to TCP:192.168.12.8:12201 socket not available":