Randomly functions connected to events will throw errors: "X is not safe to call in parallel"

Reproduction Steps
I noticed some errors X is not safe to call in parallel being thrown from one of my scripts yesterday. It is not under an Actor, is not desynchronizing at any point, and is not and has never used parallel Lua API.

The parallel Lua flag was flipped yesterday, so presumably this started happening when that happened. Not sure if multiple flag flips were involved that may have resulted in a brief moment where this was broken wherein it is now fixed, or if this has already been fixed, but I’ll report this anyway just in case since others seemed to be having this issue as well.

Perhaps other users have a more concrete repro case.

These errors were one-offs and seemed rare, happening totally at random. I only found these two yesterday, but I haven’t found any more today. I have no repro for this because it is rare.

The full code is not terribly useful to include because it is a straight forward chain of module requires and function calls that result in a simple forever-connection to PlayerAdded that fires a function. The code that’s erroring in that function runs after some HTTP calls and some datastore calls. The datastore module is third party (DataSync by Mullets) so I don’t know exactly what it’s doing, but there is no parallel Lua.

image

SetupServer requires SetupPlayerJoin which connects to PlayerAdded which fires onPlayerAdded, then you can follow the stack trace.
This code has not been updated for a while. There is no parallel Lua whatsoever.

Expected Behavior
This code should not error, and has never errored before.

Actual Behavior
Parallel Lua errors are thrown from code that is not using parallel Lua, and has not changed for a long time.

Workaround
There is no workaround.

Though this is rare, this breaks my game for players who experience it.

Issue Area: Engine
Issue Type: Other
Impact: Moderate
Frequency: Rarely
Date First Experienced: 2021-10-01 00:10:00 (-05:00)

3 Likes

Can you check if this is still happening? We disabled parallel Lua yesterday.

2 Likes

I did not see any new errors like this when I checked this morning, but I decided to make the bug report anyway just for visibility’s sake.

2 Likes