harshitsingh070 opened a new pull request, #781:
URL: https://github.com/apache/wayang/pull/781
### Description
Fixes #778
What was the issue?
The TensorflowModelTest was non-deterministically failing during the
Maven Surefire teardown phase, causing the build to
fail with a SIGABRT (Process Exit Code: 134) and the error: "The forked
VM terminated without properly saying goodbye".
This issue was traced back to native memory resource leaks in the test
file. The test utilized an unclosed Ops.create()
(which spins up a global EagerSession) and unclosed Eager Tensor
instances (such as predicted , tf.constant , and
argMax ) for printing test predictions. When the JVM began shutting down,
the garbage collector would attempt to clean
these up concurrently, causing a race condition and a native crash within
the TensorFlow C API.
How was it fixed?
• Wrapped the predicted graph tensor in a Java try-with-resources
block to ensure deterministic and safe na-tive memory
cleanup.
• Replaced the EagerSession and TensorFlow argMax operations with a
standard Java nested loop to compute the argmax .
### How was this tested?
[✓] Reproduced the original crash locally using mvn test
-Dtest=TensorflowModelTest -pl wayang-platforms/wayang-tensorflow .
[✓] Verified that the test now reliably passes and prints the expected
predictions without throwing a VM crash during JVM
teardown.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]