You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We don't have explicit logic for enforcing that instance data from one JS thread can't be shared with another JS thread. This test case shows how a Neon module can store a rooted handle in a global cell from one JS thread and then attempt to access it in another thread. In my tests this seems to hang sometimes, and other times panics with a confusing error:
I believe the fix is to tag Root structs with information about which thread they came from, and check on root.to_inner() that the context comes from the same thread, predictably panicking with a clearer error message. An alternative would be for to_inner() to produce a Result but that seems like a loss of ergonomics for a fairly rare and subtle failure.
The text was updated successfully, but these errors were encountered:
We don't have explicit logic for enforcing that instance data from one JS thread can't be shared with another JS thread. This test case shows how a Neon module can store a rooted handle in a global cell from one JS thread and then attempt to access it in another thread. In my tests this seems to hang sometimes, and other times panics with a confusing error:
Stack trace
I believe the fix is to tag
Root
structs with information about which thread they came from, and check onroot.to_inner()
that the context comes from the same thread, predictably panicking with a clearer error message. An alternative would be forto_inner()
to produce aResult
but that seems like a loss of ergonomics for a fairly rare and subtle failure.The text was updated successfully, but these errors were encountered: