-
Notifications
You must be signed in to change notification settings - Fork 326
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
State and Contexts are not preserved through the Polyglot boundary #7117
Comments
I'm implementing some synchronization primitives in #7072 using Java and callbacks and then inside of such synchronized methods the execution context information gets reset, leading to invalid results in my computations. I will add workarounds for this, but I think the current behaviour is incorrect and not intuitive. If we have to keep it, we at least need to very carefully document this oddity somewhere. |
Currently We should use ContextThreadLocal to store the |
it is impossible to write a sensible unit test for this due to bug #7117
Bumping this issue as I ran into it again when working on #10609 - I was surprised why a |
Running some tests I noticed logs like ``` sty 21, 2025 10:12:30 PM org.enso.database.dryrun.OperationSynchronizer runMaintenanceActionIfPossible SEVERE: A maintenance action failed with exception: As writing is disabled, cannot execute an update query. Press the Write button ▶ to perform the operation. ``` They appear rather randomly. This PR should provide a workaround until #7117 is fixed.
Jaroslav Tulach reports a new STANDUP for yesterday (2025-02-16): Progress: .
|
Jaroslav Tulach reports a new STANDUP for yesterday (2025-02-17): Progress: .
|
Whenever I call an Enso callback from within a polyglot call (i.e. I pass an Enso callback to a Java code as
Function<A,B>
and then execute that function in the Java code), the data about theState
and more importantlyContext
s is lost.Repro
Create a new project, with a file
polyglot/java/foo/foo/Foo.java
:then in
polyglot/java/foo
runjavac foo/Foo.java
to getpolyglot/java/foo/foo/Foo.class
.Now modify
src/Main.enso
to be:and run the project.
Expected results
Actual results
We can see that inside of the callbacks that were executed by a Java call both the State and output context are lost - the state is treated as uninitialized and the Output context gets 're-enabled'.
I don't think this is correct.
The text was updated successfully, but these errors were encountered: