Skip to content

8378257: [IR Framework] Add identity for socket connection and prepare for parsing C2 dumps#30536

Open
chhagedorn wants to merge 2 commits intoopenjdk:masterfrom
chhagedorn:JDK-8378257
Open

8378257: [IR Framework] Add identity for socket connection and prepare for parsing C2 dumps#30536
chhagedorn wants to merge 2 commits intoopenjdk:masterfrom
chhagedorn:JDK-8378257

Conversation

@chhagedorn
Copy link
Copy Markdown
Member

@chhagedorn chhagedorn commented Apr 1, 2026

This patch adds an identity handshake for the Test VM client connection to the TestFrameworkSocket. The identity will be required once we also send dumps from C2 to differentiate between different connections.

As an additional preparation step, I already split off the shared TestVmMessageParser interface from the full patch that is later also implemented by the C2 method dump parser (no semantic change).

Thanks,
Christian


Progress

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue

Issue

  • JDK-8378257: [IR Framework] Add identity for socket connection and prepare for parsing C2 dumps (Sub-task - P4)

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/30536/head:pull/30536
$ git checkout pull/30536

Update a local copy of the PR:
$ git checkout pull/30536
$ git pull https://git.openjdk.org/jdk.git pull/30536/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 30536

View PR using the GUI difftool:
$ git pr show -t 30536

Using diff file

Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/30536.diff

Using Webrev

Link to Webrev Comment

@bridgekeeper
Copy link
Copy Markdown

bridgekeeper bot commented Apr 1, 2026

👋 Welcome back chagedorn! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 1, 2026

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot added the hotspot-compiler hotspot-compiler-dev@openjdk.org label Apr 1, 2026
@openjdk
Copy link
Copy Markdown

openjdk bot commented Apr 1, 2026

@chhagedorn The following label will be automatically applied to this pull request:

  • hotspot-compiler

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Apr 1, 2026
@mlbridge
Copy link
Copy Markdown

mlbridge bot commented Apr 1, 2026

Webrevs

Copy link
Copy Markdown
Contributor

@mhaessig mhaessig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the continuous improvement of the IR framework, @chhagedorn! I have a question and a nit.

try {
client.setSoTimeout(10000);
identity = reader.readLine();
client.setSoTimeout(0);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is 0 really the default or indeed a sensible timeout?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

0 corresponds to no timeout/infinite which is the default. I only temporarily set it to 10s to catch issues early when no connection can be established initially.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case it makes sense :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably doesn't make any difference in practice, but should the timeout reset be put in a finally block to be sure that it is always reset?

…orkSocket.java

Co-authored-by: Manuel Hässig <manuel@haessig.org>
@chhagedorn
Copy link
Copy Markdown
Member Author

Thanks for your review @mhaessig! I've pushed an update fixing the typos.

Copy link
Copy Markdown
Contributor

@mhaessig mhaessig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing my comment and answering my question. Looks good.

Copy link
Copy Markdown
Contributor

@dafedafe dafedafe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @chhagedorn! Looks good to me. I just have a couple of small things/questions...

Socket client = serverSocket.accept();
BufferedReader reader = new BufferedReader(new InputStreamReader(client.getInputStream()));
submitTask(client, reader);
String identity = readIdentity(client, reader).trim();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could readIdentity return null? If so, should that be specifically handled, or is it OK to pass it up? (It will throw a TestFrameworkException in the caller but maybe we want a different message...)

try {
client.setSoTimeout(10000);
identity = reader.readLine();
client.setSoTimeout(0);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It probably doesn't make any difference in practice, but should the timeout reset be put in a finally block to be sure that it is always reset?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hotspot-compiler hotspot-compiler-dev@openjdk.org rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

3 participants