Skip to content

(0.44) Enable per-connection JITServer AOT cache disabling #19166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

cjjdespres
Copy link
Contributor

If a JITServer client uses -XX:+JITServerAOTCacheIgnoreLocalSCC, servers that client connects to will now

  1. Fail a compilation completely if the client requests an AOT cache store and the server cannot set up the compilation as an AOT cache store or load, and

  2. Report the state of the server's AOT cache if (1) occurs, so the client will not continue to send AOT cache requests to that server if those requests could not possibly be fulfilled.

The client tracks the state of the current server's AOT cache with the persistent info properties doNotRequestJITServerAOTCacheStore() and doNotRequestJITServerAOTCacheLoad(). Since a particular server's cache will never become able to complete AOT cache loads or stores partway through a connection (e.g., the server's cache never shrinks in size, so AOT cache stores will never succeed once it is full) these properties remain true once set for the duration of the connection with a particular server. They are reset whenever a client connects to a new server.

These changes are necessary to prevent a crash at the client from occurring if the client is running with -XX:+JITServerUseAOTCache -XX:+JITServerAOTCacheIgnoreLocalSCC and connects to a server that is not running -XX:+JITServerUseAOTCache (or, more generally, has an AOT cache in which methods or records cannot be stored).

This PR also fixes a bug that prevented the deserializer from being reset when a client connected to a new server after a previous disconnection.

Related: #18990

If a JITServer client uses -XX:+JITServerAOTCacheIgnoreLocalSCC,
servers that client connects to will now

1. Fail a compilation completely if the client requests an AOT cache
   store and the server cannot set up the compilation as an AOT cache
   store or load, and

2. Report the state of the server's AOT cache if (1) occurs, so the
   client will not continue to send AOT cache requests to that server
   if those requests could not possibly be fulfilled.

The client tracks the state of the current server's AOT cache with
the persistent info properties doNotRequestJITServerAOTCacheStore() and
doNotRequestJITServerAOTCacheLoad(). Since a particular server's cache
will never become able to complete AOT cache loads or stores partway
through a connection (e.g., the server's cache never shrinks in size,
so AOT cache stores will never succeed once it is full) these properties
remain true once set for the duration of the connection with a
particular server. They are reset whenever a client connects to a new
server.

Signed-off-by: Christian Despres <[email protected]>
The new _hasConnectedToServer flag in the persistent info is true at a
JITServer client when it has previously connected to a server,
regardless of the current status of any server connection. Tracking
this property is necessary to ensure that the deserializer is reset
on new connections, as the previous method (checking if the serverUID is
0) is not reliable for that purpose.

This fixes a bug that prevented the deserializer from being reset when
a client connected to a new server.

Signed-off-by: Christian Despres <[email protected]>
Signed-off-by: Christian Despres <[email protected]>
@cjjdespres cjjdespres requested a review from dsouzai as a code owner March 18, 2024 14:23
@cjjdespres
Copy link
Contributor Author

This is a cherry-pick of commits b7d759b, aab183d, and 698b8c5. These make up PR #19133, which fixes a crash that occurs when a client requests an AOT cache store that cannot be fulfilled by the server, as well as a bug affecting deserializer resetting.

Attn @mpirvu.

@mpirvu mpirvu self-assigned this Mar 18, 2024
Copy link
Contributor

@mpirvu mpirvu left a comment

Choose a reason for hiding this comment

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

I have verified that the patch is identical to the one from the original PR that targets the main branch.

@mpirvu mpirvu merged commit 747f86c into eclipse-openj9:v0.44.0-release Mar 18, 2024
@mpirvu mpirvu added the comp:jitserver Artifacts related to JIT-as-a-Service project label Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:jitserver Artifacts related to JIT-as-a-Service project
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants