Thread Tools Display Modes
06-18-17, 06:56 PM   #1
Arcinde
A Defias Bandit
Join Date: Jun 2017
Posts: 3
"script ran too long" out-of-combat after 7.2.5

I've been getting a "script ran too long" error with several addons after 7.2.5 hit. Interestingly this happens out-of-combat which is strange because I thought that the addon execution time limit applied only in combat.

Here are pastes of the errors:
If you look at the lines where this is happening in Details, you'll notice that they are expected long-running functions (collectgarbage, UpdateAddOnMemoryUsage) that are surrounded by a `not InCombatLockdown()` clause. The Details author clearly had the same idea as me, that addon execution time limit is only enforced in-combat and it should be safe to call these expensive functions outside of combat. I know ArkInventory has some coroutine-stuff that yields in combat when it would otherwise hit the script execution time limit, but does not do so outside of combat.

So does anyone know, what has changed in 7.2.5 that causes script execution time to sometimes be enforced out of combat? This doesn't seem to be a consistent thing since if I type in chat something like
/run local x=1 for i=1,5*10^8 do x=x+i end
it will happily run for 4 seconds without any errors (as long as I'm not in combat).
  Reply With Quote
06-24-17, 05:17 PM   #2
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Thumbs down

I'm curious about this too. I have a configuration panel created on demand that contains quite a few textures and frames and can sometimes cause a small stutter when loaded for the first time. In almost all cases where that happens, this error is not produced, but as of 7.2.5 I've seen it once or twice.

These configuration panels are not accessible in combat, so the "script ran too long" error is truly pointless in this case. It also breaks the execution path and displays incomplete panels when it happens.

I'm really wondering what the point is. Why break the code if it's executed out of combat and seemingly has more to do with the UI back end than how the code is written? The end user of an add-on probably prefers a small frame stutter over broken code and lua errors. Hopefully it's just a bug.
__________________

Last edited by MunkDev : 06-24-17 at 05:19 PM.
  Reply With Quote
06-25-17, 01:33 AM   #3
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Seems like it's applied out of combat now too, which is bad news for load on demand addons.
  Reply With Quote
06-25-17, 02:06 AM   #4
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
GetContainerItemLink and GetContainerItemInfo have been causing these errors for me in an addon I use, SmartBuff, especially after hearthing/portaling (ie. PLAYER_ENTERING_WORLD) but also at random times I've attributed to OnUpdate overload.

Basically cycling through bags and slots in a loop I've "de-compressed" the timing of these calls with a C_Timer.After as well as after the event which to-date has "fixed" this particular problem.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.

Last edited by Fizzlemizz : 06-25-17 at 02:23 AM.
  Reply With Quote
06-26-17, 03:09 PM   #5
Tercioo
An Aku'mai Servant
 
Tercioo's Avatar
AddOn Author - Click to view addons
Join Date: Aug 2014
Posts: 38
Still could be an issue with InCombatLockdown() saying "yeah you are out of combat, kappa".
  Reply With Quote
06-26-17, 05:45 PM   #6
Kanegasi
A Molten Giant
 
Kanegasi's Avatar
AddOn Author - Click to view addons
Join Date: Apr 2007
Posts: 666
Yea, I've never trusted InCombatLockdown() by itself. There's actually other functions that can't be trusted, like IsInGroup() returning false while in a group. My addons that deal with combat restrictions combine that with a variable set by the REGEN events. Both the variable and the function return have to be false before I do things meant for out-of-combat.
  Reply With Quote
06-26-17, 05:45 PM   #7
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Originally Posted by Tercioo View Post
Still could be an issue with InCombatLockdown() saying "yeah you are out of combat, kappa".
Seems unlikely.
__________________
  Reply With Quote
06-26-17, 05:59 PM   #8
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
I had the error portaling from major city to major city after logging in.
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
06-26-17, 11:52 PM   #9
Arcinde
A Defias Bandit
Join Date: Jun 2017
Posts: 3
Just logging in, moving/jumping around, and then doing the long-running thing (opening bags, opening WA options) can sometimes trigger it for me. No zoning, no combat. There may or may not have been combat log events, not 100% sure.
  Reply With Quote
06-27-17, 03:43 AM   #10
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by Kanegasi View Post
Yea, I've never trusted InCombatLockdown() by itself. There's actually other functions that can't be trusted, like IsInGroup() returning false while in a group. My addons that deal with combat restrictions combine that with a variable set by the REGEN events. Both the variable and the function return have to be false before I do things meant for out-of-combat.
I've only used InCombatLockDown() for years and never had any issue. If you log into the game while you are in combat it will return false, but thats intended.
  Reply With Quote
07-01-17, 03:21 PM   #11
Nimhfree
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 267
Originally Posted by Resike View Post
I've only used InCombatLockDown() for years and never had any issue. If you log into the game while you are in combat it will return false, but thats intended.
Why on earth would it be intended to return incorrect information when you log into the game and are in combat? Does it really return true in this case only after some other event is processed?
  Reply With Quote
07-01-17, 04:29 PM   #12
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by Nimhfree View Post
Why on earth would it be intended to return incorrect information when you log into the game and are in combat? Does it really return true in this case only after some other event is processed?
Because it's not indicating if you are in combat or not, it's showing if you can make changes on secure frames or not.
  Reply With Quote
07-03-17, 05:48 AM   #13
Nimhfree
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 267
Originally Posted by Resike View Post
Because it's not indicating if you are in combat or not, it's showing if you can make changes on secure frames or not.
So the implication is if one logs into the game and is in combat, then one can make changes on secure frames. If this is actually true, then Blizzard has a hole in their system. I would think that the secure frames are really not editable at that point either, but have not tested this theory.
  Reply With Quote
07-03-17, 06:48 AM   #14
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by Nimhfree View Post
So the implication is if one logs into the game and is in combat, then one can make changes on secure frames. If this is actually true, then Blizzard has a hole in their system. I would think that the secure frames are really not editable at that point either, but have not tested this theory.
It's not a hole it's only for like 2 seconds.
It would be more retarded when you dc in a bossfight then not a single addon could build up their secure frames after you log back in.

Last edited by Resike : 07-03-17 at 06:50 AM.
  Reply With Quote
07-03-17, 10:58 AM   #15
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Originally Posted by Nimhfree View Post
I would think that the secure frames are really not editable at that point either, but have not tested this theory.
Save your time, because your theory is wrong.
Combat and lockdown are two separate things and the lockdown always fires after you enter combat. You can even use an event handler to do secure stuff in response to entering combat, which is useful for when you have some behaviour that happens on secure frames but should only happen in or out of combat.

If your theory was true, any action bar addon, unit frame addon or anything else using secure templates would not work when you log in after a disconnect mid-combat.
__________________

Last edited by MunkDev : 07-03-17 at 11:03 AM.
  Reply With Quote
07-03-17, 01:20 PM   #16
Lombra
A Molten Giant
 
Lombra's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2006
Posts: 554
Originally Posted by Nimhfree View Post
So the implication is if one logs into the game and is in combat, then one can make changes on secure frames. If this is actually true, then Blizzard has a hole in their system. I would think that the secure frames are really not editable at that point either, but have not tested this theory.
It's not a loophole or a bug or anything. It's just for a moment (probably before loading screen is done) so that you may construct the UI before lockdowns are in place.
__________________
Grab your sword and fight the Horde!
  Reply With Quote
07-03-17, 02:38 PM   #17
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
It also occurs for just a moment whenever entering combat to give the UI time to react to being in combat. Showing target frame, a hidden actionbar, [combat] macros, etc.
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-03-17, 07:37 PM   #18
MunkDev
A Scalebane Royal Guard
 
MunkDev's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2015
Posts: 431
Originally Posted by Seerah View Post
It also occurs for just a moment whenever entering combat to give the UI time to react to being in combat. Showing target frame, a hidden actionbar, [combat] macros, etc.
To add to this, the lockdown occurs sometime after the event PLAYER_REGEN_DISABLED has been dispatched to all frames.
__________________

Last edited by MunkDev : 07-03-17 at 11:05 PM.
  Reply With Quote
07-03-17, 08:58 PM   #19
Seerah
Fishing Trainer
 
Seerah's Avatar
WoWInterface Super Mod
Featured
Join Date: Oct 2006
Posts: 10,860
Yes. PLAYER_REGEN_DISABLED is the event to look for to know when you are entering combat.

event fires
UI updates for combat
InCombatLockDown() returns true
__________________
"You'd be surprised how many people violate this simple principle every day of their lives and try to fit square pegs into round holes, ignoring the clear reality that Things Are As They Are." -Benjamin Hoff, The Tao of Pooh

  Reply With Quote
07-06-17, 02:59 PM   #20
AmiYuy
A Fallenroot Satyr
 
AmiYuy's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2006
Posts: 22
FYI according to Infus in response to my ticket about this error with WeakAuras, this is a Blizzard error that will be fixed with 7.3.

https://www.wowace.com/projects/weakauras-2/issues/981
  Reply With Quote

WoWInterface » Developer Discussions » General Authoring Discussion » "script ran too long" out-of-combat after 7.2.5

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off