RFR: 7903730: Enhance the agentvm to be tolerant to unexpected connection on the port the Agent listens on for handshake with the AgentServer [v3]
Daniel Fuchs
dfuchs at openjdk.org
Thu May 23 15:55:18 UTC 2024
On Thu, 23 May 2024 13:44:13 GMT, Mark Sheppard <msheppar at openjdk.org> wrote:
>> Jaikiran Pai has updated the pull request incrementally with one additional commit since the last revision:
>>
>> reduce the scope of the try/catch and fix potential short read() issue
>
> src/share/classes/com/sun/javatest/regtest/exec/Agent.java line 266:
>
>> 264: }
>> 265: // we don't read more than handshake bytes in this method
>> 266: assert totalRead <= JTREG_AGENT_HANDSHAKE_MAGIC.length : "unexpected number of handshake" +
>
> slight contradiction on the assert with the if condition on the following line
> do you need an assert her with condition on the next line
> I find them anomalous, if a condition is worth testing and appropriate put it in an if statement.
It would be an error if totalRead was > JTREG_AGENT_MAGIC.length: according to the logic of the code that reads the magic that cannot happen, ever. Hence the assert.
-------------
PR Review Comment: https://git.openjdk.org/jtreg/pull/195#discussion_r1611945550
More information about the jtreg-dev
mailing list