RFR: 7903730: Enhance the agentvm to be tolerant to unexpected connection on the port the Agent listens on for handshake with the AgentServer [v3]

Jonathan Gibbons jjg at openjdk.org
Mon May 20 23:18:15 UTC 2024


On Mon, 20 May 2024 13:57:01 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:

>> src/share/classes/com/sun/javatest/regtest/exec/Agent.java line 264:
>> 
>>> 262:                 s.close();
>>> 263:             } catch (IOException ignored) {
>>> 264:                 // ignore
>> 
>> Please don't swallow exceptions.
>
> In this case it's intentional. Here we are closing a unexpected/rogue connection and if any errors result during that close, we don't want to propagate it nor do I think we want to print a stacktrace for it.

Use `Throwable.addSuppressed` -- it is for exactly this situation.

-------------

PR Review Comment: https://git.openjdk.org/jtreg/pull/195#discussion_r1607385490


More information about the jtreg-dev mailing list