JITServer: handle non-null compilation - #23846
Conversation
c9c432d to
4628208
Compare
There was a problem hiding this comment.
I don't agree with the solution in this PR. The block of code that supposedly throws the StreamFailure exception you are trying to catch cannot be executed on the server. The block is protected by if (entry->isAotLoad() and AOT loads are only executed at the client. Moreover, the function that supposedly causes the StreamFailure has been redefined at JITServer:
virtual uint16_t getAllEnabledHints(J9Method *method) override
{
TR_ASSERT_FATAL(false, "called");
return 0;
}
so we know it cannot be executed.
The high level pseudocode of the code is like this:
try {
preCompilationTasks()
compile()
postCompilationTasks()
} catch {
TR_ASSERT_FATAL(comp==NULL)
postCompilationTasks()
}
It's possible that there is an exception thrown from postCompilationTasks(), but it's not caused by getAllEnabledHints. compilationEnd() is called from postCompilationTasks() and that's a big method. Maybe that one could throw?
|
|
|
It's very likely that there is an exception being generated in postCompilationTasks(). The comments for that method say: so we should not allow any exception to escape, but at the same time we cannot put a try/catch block around the entire method because we must execute all cleanup actions that postCompilationTasks() is supposed to do.
However, the methods above already have try/catch blocks around them, so they are not the culprits. |
a0abbf0 to
d94b94d
Compare
d94b94d to
219a64d
Compare
219a64d to
ef157f6
Compare
ef157f6 to
bc35349
Compare
|
jenkins test sanity plinuxjit,xlinuxjit,zlinuxjit,alinux64jit jdk21 |
bc35349 to
7fdc06e
Compare
|
jenkins test sanity,extended plinuxjit,xlinuxjit,zlinuxjit,alinux64jit jdk21 |
|
The following test suite had three errors jdk_collections_0 jdk_stream_0 |
|
The following test suite had one error |
|
The following test suite had 3 errors jdk_stream_0 jdk_security2_0 |
|
It appears that the build failures in this test suite all have the same common cause. |
|
At least one of the aborted tests, extended.functional on xlinux, had multiple tests that experienced a timeout. The timeouts generate coredumps which fill the disk space. |
|
jenkins test sanity.functional xlinux,xlinuxjit jdk21 |
|
Related, this Grinder I ran to test the issue has completed 75 out of 100 iterations of the original test case without any errors being thrown |
7fdc06e to
919d522
Compare
0aa2bad to
2cc5681
Compare
|
Grinder with 100 iterations: |
9cf62db to
23c9130
Compare
|
New Grinder with the updated implementation |
| TRIGGER_J9HOOK_JIT_COMPILING_END(_jitConfig->hookInterface, vmThread, method); | ||
|
|
||
| if (_compiler && _methodBeingCompiled->isOutOfProcessCompReq()) { | ||
| // If JITServer is enabled, this will send messages |
There was a problem hiding this comment.
Suggested re-phrasing:
// In JITServer mode preemtively call _compiler->retainedMethods() to
// create the retainedMethod set if it doesn't exist. If this operation
// is not done now, it will be done later during:
// postCompilationTasks
// - compilationEnd
// - outOfProcessCompilationEnd
// - computeDataForCHTableCommit
// - getDataForClient
// The server will send a message to the client, which could cause an
// exception and exceptions are not allowed to be triggerred from postCompilationTasks()
| bool useServerOffsets = aotCacheStore && clientData->useServerOffsets(entry->_stream); | ||
| bool useServerOffsets = aotCacheStore; | ||
| try { | ||
| // in the case useServerOffsets triggers an message |
There was a problem hiding this comment.
If using full sentences, the sentence must start with a capital letter.
There was a problem hiding this comment.
Suggested re-phrasing:
Guard useServerOffsets() with a try block to prevent exceptions from
interrupting the flow of postCompilationTasks() at a higher level.
23c9130 to
8e96082
Compare
When a JITServer stream failure is thrown, sometimes setting the compilation object to NULL can be skipped to head straight into exception handling. This causes an assert to be tripped. In this particular case, there is a front-end call in outOfProcessCompilationEnd (within computeDataForCHTableCommit) which can cause a stream error. Since it isn't guarded by a global try-catch, it results in the given assert being tripped. Addresses this issue: eclipse-openj9#23845
8e96082 to
51a5cc0
Compare
|
jenkins test sanity plinuxjit,xlinuxjit,zlinuxjit,alinux64jit jdk25 |
|
xlinux had one failure: for testJITServer_0 10x grinder passed: https://openj9-jenkins.osuosl.org/job/Grinder/5237/ |
|
Since all tests passed (the xlinux one was infra related), this PR is ready to be merged. |
When a JITServer stream failure is thrown, sometimes setting
the compilation object to NULL can be skiped to head straight
into exception handling. This causes an assert to be tripped.
In this particular case, there is a front-end call in
postCompilationTasks which can cause a stream error. Since it
isn't guarded by a global try-catch, it results in the given
assert being tripped.
Addresses this issue:
#23845