Skip to content

Modify forceLoad to return isLoaded #2022

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

samfreund
Copy link
Member

Description

forceLoad for JNIs will now return the isLoaded variable of a given JNI. This is then used in the main server script to log whether the JNI was succesfully created.

Meta

Merge checklist:

  • Pull Request title is short, imperative summary of proposed changes
  • The description documents the what and why
  • If this PR changes behavior or adds a feature, user documentation is updated
  • If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly
  • If this PR touches configuration, this is backwards compatible with settings back to v2024.3.1
  • If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated
  • If this PR addresses a bug, a regression test for it is added

@samfreund samfreund requested a review from a team as a code owner August 2, 2025 18:07
@spacey-sooty
Copy link
Member

What? Forceload guarantees that the library is loaded if the program continues

@samfreund
Copy link
Member Author

What? Forceload guarantees that the library is loaded if the program continues

I'm not quite sure what you mean? ForceLoad from the JNICommon just attempts to load the libraries. The change made by this PR is just returning the success of that attempt, as a Boolean.

@spacey-sooty
Copy link
Member

The program should crash if it's not able to load the native library. That's why you use forceLoad

@samfreund
Copy link
Member Author

The program should crash if it's not able to load the native library. That's why you use forceLoad

If the shared objects are unable to be found, the program doesn't crash. We might also be talking about a different force load function, I'm specifically referring to the one that loads native libraries from the jar.

@samfreund samfreund marked this pull request as draft August 3, 2025 02:35
@samfreund samfreund force-pushed the return-from-jni-common branch from 079cb08 to 610f1e2 Compare August 4, 2025 04:09
@samfreund
Copy link
Member Author

See here for more info.

@samfreund samfreund added the bug Something isn't working label Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants