Roblox takes ages to quit a file or stop testing

Recently i have had a lot of issues with roblox studio, it takes ages to exit out of a game test or even just close roblox studio.

When trying to stop testing it just takes me back to my script but i cant actually do anything for over 10 seconds. This doesnt always happen.

And when trying to close studio it just wont, when i hit the X button it just hides everything except the topbar and it takes a few minutes to actually fully close. The window stays open.

Also sometimes the autocomplete just dissapears and doesnt return for no reason, which makes me have to exit out of studio first even though this also doesnt always fix it.

Does anyone know a fix for this?

2 Likes

This has been happening to me a lot recently too, I get spammed with this message when it finally does decide to end

11:37:43.900 Disconnect from 127.0.0.1|52441 - Studio
11:38:13.909 Not running script because past shutdown deadline - Server
11:38:13.909 Not running script because past shutdown deadline - Server
11:38:13.909 Not running script because past shutdown deadline - Server
11:38:13.909 Not running script because past shutdown deadline - Server
11:38:13.909 Not running script because past shutdown deadline - Server
11:38:13.909 Not running script because past shutdown deadline - Server
11:38:13.910 Not running script because past shutdown deadline - Server
11:38:13.910 Not running script because past shutdown deadline - Server
11:38:13.910 Not running script because past shutdown deadline - Server
11:38:13.910 Not running script because past shutdown deadline - Server
11:38:13.910 Not running script because past shutdown deadline - Server
11:38:13.910 Not running script because past shutdown deadline - Server
11:38:13.910 Not running script because past shutdown deadline - Server
11:38:13.910 Not running script because past shutdown deadline - Server
11:38:13.910 Not running script because past shutdown deadline - Server
11:38:13.910 Not running script because past shutdown deadline - Server
11:38:13.910 Not running script because past shutdown deadline - Server
11:38:13.911 Not running script because past shutdown deadline - Server
11:38:13.911 Not running script because past shutdown deadline - Server
11:38:13.911 Not running script because past shutdown deadline - Server
11:38:13.911 Not running script because past shutdown deadline - Server

3 Likes

Do you have any scripts that happen to loop infinitely when the game closes?

1 Like

None that I can find, all have exits



its not constant either, sometimes its slow, sometimes its fast

Happens to me too, for some reason its because of the NewUI beta
Idk how their engineers managed to do that :sob:

If you don’t have the newUI enabled (in the studio beta settings) I can’t help you but if u have it try deactivating it

Let me know if it helped!

1 Like

Sorry that I’m late, but closure callbacks such as game.OnClose can do this too, not just infinitely executing loops, which would likely time out (throw ā€œexhausted allowed execution timeā€) before throwing these errors. Open Studio, click ā€˜Run’ in a Place, execute the following in Command Line: game.OnClose = coroutine.yield (or game.OnClose = function() coroutine.yield() end), and click ā€˜Stop.’ It’ll delay the game closure and throw those errors in Output, because it waits until the callback thread dies (by returning or reaching the end, not yielding), which never happens. This has happened to me once when I implemented server and client-sided scripts to log when players initiate disconnects, and since the server shuts down before it can handle and return the packet, it infinitely yielded:

--!strict
local EXPIRY_DELAY = 2 -- Second(s)

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RunService = game:GetService("RunService")

local Remotes = ReplicatedStorage:WaitForChild("Remotes")

local DebugRemotes = Remotes:WaitForChild("Debug")
local ClientDisconnectInitiatedRemote = DebugRemotes:WaitForChild("ClientDisconnectInitiated")

if RunService:IsStudio() then
	print(`[{script}]: Run-time environment is Studio. Killing root {coroutine.running()}`)

	script:Destroy()

	return
end

game.OnClose = function()
	print(`[{script}]: Disconnect initiated. Invoking {ClientDisconnectInitiatedRemote}...`)

	local thread = Instance.new("BindableEvent")

	local threads = {
		task.spawn(function()
			ClientDisconnectInitiatedRemote:InvokeServer(workspace:GetServerTimeNow())

			thread:Fire(true)
		end),
		task.delay(EXPIRY_DELAY, thread.Fire, thread, nil)
	}

	local timestamp = os.clock()

	local result: boolean? = thread.Event:Wait()

	for _, thread in threads do
		task.cancel(thread)
	end

	if result then
		print(`[{script}]: {ClientDisconnectInitiatedRemote} returned in {math.floor((os.clock() - timestamp) * 1e3)} ms. Resuming closure.`)
	else
		warn(`[{script}]: {ClientDisconnectInitiatedRemote} did not return in less than or equal to {EXPIRY_DELAY} second(s). Resuming closure.`)
	end

	task.defer(function()
		game.OnClose = nil

		script:Destroy()
	end)
end

I’m not sure if game.BindToClose does the same, but it’s more commonly used than game.OnClose (there are some others as well), so it’s possible that something like this, if it exists in your codebase, is causing it. Or, since the previous reply is citing Next Gen Studio UI, it could be that too, although I haven’t been experiencing it myself. I hope this helps.

this happens to me too.
I used to see only a long list of ā€œNot running script because past shutdown deadline - Serverā€

But today I started seeing a list of exactly which script and which line might be causing issues. Here is a sample:

17:40:32.711 Not running script because past shutdown deadline (when calling anonymous function on line 149 in cloud_948084095.TagEditor.Plugin.Components.TooltipView) - Server
17:40:32.711 Not running script because past shutdown deadline (when calling anonymous function on line 21 in cloud_948084095.TagEditor.Plugin.Components.TooltipView) - Server
17:40:32.712 Not running script because past shutdown deadline (when calling anonymous function on line 81 in cloud_14565194943.UGCCreationTool.Packages._Index.roblox_rodux@3.0.0.rodux.Store) - Server
17:40:32.712 Not running script because past shutdown deadline (when calling anonymous function on line 87 in cloud_7707654204.PowerSelectors.Core.Modules.MainManager) - Server
17:40:32.712 Not running script because past shutdown deadline (when calling anonymous function on line 209 in cloud_2268520847.Brushtool.Core.Brushtool) - Server
17:40:32.712 Not running script because past shutdown deadline (when calling anonymous function on line 45 in cloud_2268520847.Brushtool.Libs.Rodux.Store) - Server
17:40:32.712 Not running script because past shutdown deadline (when calling anonymous function on line 45 in cloud_948084095.TagEditor.Rodux.Store) - Server
17:40:32.712 Not running script because past shutdown deadline (when calling anonymous function on line 99 in CorePackages.Packages._Index.Rodux.Rodux.Store) - Server
17:40:32.712 Not running script because past shutdown deadline (when calling anonymous function on line 1468 in ServerScriptService.Place.Managers.GameManager) - Server
17:40:32.727 Not running script because past shutdown deadline (when calling anonymous function on line 149 in cloud_948084095.TagEditor.Plugin.Components.TooltipView) - Server
17:40:32.728 Not running script because past shutdown deadline (when calling anonymous function on line 21 in cloud_948084095.TagEditor.Plugin.Components.TooltipView) - Server
17:40:32.728 Not running script because past shutdown deadline (when calling anonymous function on line 81 in cloud_14565194943.UGCCreationTool.Packages._Index.roblox_rodux@3.0.0.rodux.Store) - Server
17:40:32.728 Not running script because past shutdown deadline (when calling anonymous function on line 87 in cloud_7707654204.PowerSelectors.Core.Modules.MainManager) - Server
17:40:32.728 Not running script because past shutdown deadline (when calling anonymous function on line 209 in cloud_2268520847.Brushtool.Core.Brushtool) - Server
17:40:32.728 Not running script because past shutdown deadline (when calling anonymous function on line 45 in cloud_2268520847.Brushtool.Libs.Rodux.Store) - Server
17:40:32.728 Not running script because past shutdown deadline (when calling anonymous function on line 45 in cloud_948084095.TagEditor.Rodux.Store) - Server
17:40:32.728 Not running script because past shutdown deadline (when calling anonymous function on line 99 in CorePackages.Packages._Index.Rodux.Rodux.Store) - Server
17:40:32.728 Not running script because past shutdown deadline (when calling anonymous function on line 1468 in ServerScriptService.Place.Managers.GameManager) - Server
17:40:32.744 Not running script because past shutdown deadline (when calling anonymous function on line 149 in cloud_948084095.TagEditor.Plugin.Components.TooltipView) - Server
17:40:32.745 Not running script because past shutdown deadline (when calling anonymous function on line 21 in cloud_948084095.TagEditor.Plugin.Components.TooltipView) - Server
17:40:32.745 Not running script because past shutdown deadline (when calling anonymous function on line 81 in cloud_14565194943.UGCCreationTool.Packages._Index.roblox_rodux@3.0.0.rodux.Store) - Server
17:40:32.745 Not running script because past shutdown deadline (when calling anonymous function on line 87 in cloud_7707654204.PowerSelectors.Core.Modules.MainManager) - Server
17:40:32.745 Not running script because past shutdown deadline (when calling anonymous function on line 209 in cloud_2268520847.Brushtool.Core.Brushtool) - Server
17:40:32.745 Not running script because past shutdown deadline (when calling anonymous function on line 45 in cloud_2268520847.Brushtool.Libs.Rodux.Store) - Server
17:40:32.745 Not running script because past shutdown deadline (when calling anonymous function on line 45 in cloud_948084095.TagEditor.Rodux.Store) - Server
17:40:32.745 Not running script because past shutdown deadline (when calling anonymous function on line 99 in CorePackages.Packages._Index.Rodux.Rodux.Store) - Server
17:40:32.745 Not running script because past shutdown deadline (when calling anonymous function on line 1468 in ServerScriptService.Place.Managers.GameManager) - Server
17:40:32.746 :play_button: Not running script because past shutdown deadline (when calling anonymous function on line 220 in builtin_MoveDragger.rbxm.MoveDragger.Packages._Index.PluginLoader.PluginLoader.PluginLoaderBuilder) (x2) - Server
17:40:32.746 Not running script because past shutdown deadline (when calling anonymous function on line 220 in builtin_RotateDragger.rbxm.RotateDragger.Packages._Index.PluginLoader.PluginLoader.PluginLoaderBuilder) - Server
17:40:32.746 Not running script because past shutdown deadline (when calling anonymous function on line 49 in builtin_StreamingServiceDispatcherRegistry.rbxm.StreamingServiceDispatcherRegistry.Bin.main) - Server
17:40:32.747 Not running script because past shutdown deadline (when calling anonymous function on line 78 in sabuiltin_ExplorerPlugin.rbxm.ExplorerPlugin.Src.Guest.startStudioGuest) - Server
17:40:32.747 Not running script because past shutdown deadline (when calling anonymous function on line 72 in cloud_165534573.ResizeAlign V1.3.ResizeAlignMain.createSharedToolbar) - Server
17:40:32.747 :play_button: Not running script because past shutdown deadline (when calling closeWidget on line 106 in cloud_2908380847.RigEditor.MainScript) (x2) - Server
17:40:32.747 Not running script because past shutdown deadline (when calling anonymous function on line 899 in cloud_4486409103.RigEditPlus.RigEdit) - Server
17:40:32.748 Not running script because past shutdown deadline (when calling anonymous function on line 19 in cloud_7707654204.PowerSelectors.Core.PluginMain) - Server
17:40:32.748 Not running script because past shutdown deadline (when calling anonymous function on line 34 in cloud_8063186370.AutoWelder.AutoWelder) - Server
17:40:32.748 Not running script because past shutdown deadline (when calling anonymous function on line 23 in cloud_6415005344.Rojo.Plugin) - Server
17:40:32.748 Not running script because past shutdown deadline (when calling anonymous function on line 171 in cloud_6355517515.ThumbnailMaker.PluginScript) - Server
17:40:32.748 Not running script because past shutdown deadline (when calling anonymous function on line 571 in cloud_14565194943.UGCCreationTool.PluginRuntime) - Server
17:40:32.748 Not running script because past shutdown deadline (when calling anonymous function on line 114 in cloud_701506235.DataStoreEditorPlugin.Code.Main) - Server
17:40:32.765 Not running script because past shutdown deadline (when calling anonymous function on line 83 in cloud_948084095.TagEditor.Plugin.Main) - Server
17:40:32.767 :play_button: Not running script because past shutdown deadline (when calling anonymous function on line 81 in cloud_948084095.TagEditor.Roact.SingleEventManager) (x7) - Server
17:40:32.779 Not running script because past shutdown deadline (when calling anonymous function on line 32 in cloud_2268520847.Brushtool.Core.Components.Foundation.PluginWidget) - Server

A small percentage of them are my scripts, but many of them are core scripts, external libraries and plugins.

It is quite a productivity killer as it prevents me from iterating quickly, having to wait 30 secs to launch the next test if the bug happens.(and it happens quite frequently)

1 Like