BindToClose 100% Infinite Yield

Same here, this problem is back and it slows down my progress making games

1 Like

I am currently having the same issue. It really wastes development time.

Can confirm this is also happening for me.

The Code

local DataStoreService = game:GetService("DataStoreService")
local DataStore = DataStoreService:GetDataStore("Datastore")

print(1, DataStore:GetAsync("Key1"))
print(2, DataStore:GetAsync("Key2"))
print(3, DataStore:GetAsync("Key3"))

game:BindToClose(function()
	DataStore:SetAsync("Key1", os.time())
	DataStore:SetAsync("Key2", os.time())
	DataStore:SetAsync("Key3", os.time())
end)

Studio Test

After running the code, it returned that all keys were nil

When I pressed Stop, my studio froze and I got the infamous error after a bit of waiting

13:59:59.373 - Not running script because past shutdown deadline (x97)

The next time I joined, it had only saved 1

1 1574603969
2
3

Live Server test

I ran the test on the live server and can (thankfully) conclude that this is only an issue in studio.


Can we please get someone to look into this?
cc @CycloneUprising

2 Likes

Itā€™s really annoying and slowing work down so much! Please fix this asap

(It happened last week for about couple of hours then got fixed in morning, and now itā€™s back from past day)

1 Like

I have a fix. Unfortunately it may take longer than normal to get into production because of the Thanksgiving holiday.

Very sorry for the inconvenience, and thanks for your patience.

55 Likes

Not all heroes wear capes. Thank you!

15 Likes

Iā€™m glad this is being fixed. I cooked myself dinner and took a nap before studio unfroze from this!

6 Likes

Glad you do, this bug has been very annoying when i test something and then i stop, and it ends up taking like 10 seconds just to stop.

DataStore2 probably uses yielding in the BindToClose code, so itā€™s not a problem with DS2. Roblox is fixing the issue now.

2 Likes

Donā€™t know if anyoneā€™s mentioned this yet, but the stall also happens with HttpService requests. Sometimes the stall alleviates itself without error, sometimes it doesnā€™t. Not entirely reproducible for the case of HttpService. Was wondering if anyone else had this issue and it looks like nearly everyone does, just with a different service.

Mine is also hanging now when the Datastore request is in PlayerRemoving.

HttpService requests are yielding functions. As this bug happens when anything yields in BindToClose, calling Http Async functions within BindToClose when this issue is persistent will result in BindToClose yielding until it times out.

1 Like

The time it took to resolve this issue both times it happened is kind of concerning, given how many user reports there were and that it requires developers to manually work around it at the expense of potential data loss related bugs. Are there any test cases set up to prevent this from happening again?

1 Like

Hey @CycloneUprising, has the fix been pushed yet? Iā€™m still receiving this error, and have to resort to using Test Server which is really slow and cumbersome for my work flow.

 15:26:08.427 - Not running script because past shutdown deadline (x117)
2 Likes

Yeah, this issue is still happening for me too.

2 Likes

I think itā€™s been fixed. At least for meā€¦ Iā€™m still waiting for the official patch info.

This should be fixed. Please let us know if you have ongoing issues.

10 Likes

Itā€™s not fixed for coroutines:

game:BindToClose(function()
	local t=coroutine.running()
	delay(1,function()
		coroutine.resume(t)
	end)
	coroutine.yield()
end)

There are many more coroutine bugs too:

2 Likes

The fix I mentioned in earlier post is now live.

8 Likes