RFR: 7903730: Enhance the agentvm to be tolerant to unexpected connection on the port the Agent listens on for handshake with the AgentServer [v3]
Mark Sheppard
msheppar at openjdk.org
Fri Jun 7 15:39:25 UTC 2024
On Fri, 7 Jun 2024 11:49:28 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> src/share/classes/com/sun/javatest/regtest/agent/AgentServer.java line 68:
>>
>>> 66: * to complete the communication handshake
>>> 67: */
>>> 68: public static final byte[] JTREG_AGENT_HANDSHAKE_MAGIC = "jtreg".getBytes(US_ASCII);
>>
>> I was developing a similar PoC for AgentSevre to Agent connectivity
>> I used the pattern "Hello Agent:" + id
>> using the Agent id in the connection string, which the Agent compared with its own id as a condition of "accepting" the AgentServer connection
>
> I had given that a thought too - the random handshake bytes that I note in a previous comment of mine https://github.com/openjdk/jtreg/pull/195#issuecomment-2121551694 is a variant of this approach where each `AgentServer` process handshakes with the `Agent` using a different handshake data. For reasons I state in that other comment, I felt that using a dynamic handshake value isn't adding much value and so decided to use a static handshake value instead.
of course you can accept or reject a suggestion, but it does add value in that it pairs the agent server and the agent by verifying the agent id passed to the agent server
-------------
PR Review Comment: https://git.openjdk.org/jtreg/pull/195#discussion_r1631392048
More information about the jtreg-dev
mailing list