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
It is unclear to me why type safety is disabled for these fields, but it appears that normally they are meant to contain a ThreadLocalMap object, judging from Fiber.switchFiberAndThreadLocals()
However FiberSerializer changes the type of these fields with no explanation:
After this code runs f.fiberLocals is now an array, not a ThreadLocalMap. No explanation is provided in the code for the type switch. This causes a crash when debugging is enabled on the next run through switchFiberAndThreadLocals when it tries to print out the contents to the debug log.
The text was updated successfully, but these errors were encountered:
It is unclear to me why type safety is disabled for these fields
Because ThreadLocalMap is package-private.
However FiberSerializer changes the type of these fields with no explanation
That's because ThreadLocalMap is not serializable.
on the next run through switchFiberAndThreadLocals
Ah, but in the original use-case for serialization, there would be no next run. Once a fiber is serialized, the original fiber was presumed to be discarded until a new one is recreated from the serialized representation.
It seems like fiber serialization needs to be retrofitted to allow your use-case. I don't think it's a big change by any means, but the current assumptions are wrong.
Fiber defines the following fields:
private Object fiberLocals; private Object inheritableFiberLocals;
It is unclear to me why type safety is disabled for these fields, but it appears that normally they are meant to contain a ThreadLocalMap object, judging from Fiber.switchFiberAndThreadLocals()
However FiberSerializer changes the type of these fields with no explanation:
After this code runs f.fiberLocals is now an array, not a ThreadLocalMap. No explanation is provided in the code for the type switch. This causes a crash when debugging is enabled on the next run through switchFiberAndThreadLocals when it tries to print out the contents to the debug log.
The text was updated successfully, but these errors were encountered: