History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: LPP-5088
Type: New Feature New Feature
Status: Closed Closed
Resolution: Fixed
Priority: P0 P0
Assignee: Unassigned
Reporter: Antun Karlovac
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
OpenLaszlo

Enable scriptLimits override in Flash

Created: 12/Nov/07 02:02 PM   Updated: 07/Dec/07 10:56 AM
Component/s: Compiler - JavaScript
Affects Version/s: 4.0.6/Jujube
Fix Version/s: RingDing (4.1), 4.0.5WaffleCone

Time Tracking:
Not Specified

File Attachments: 1. File lpp-5088.lzx (2 kb)


Severity: Minor
Fixed in Change#: 7,459
Runtime: N/A
Flags: Support
Fix in hand: False


 Description  « Hide
Flash 7 and up allows for the scriptLimits tag to be set. This overrides the normal timeout and/or recursion depth checks in the Flash Player, which trigger the script-running-slowly error. With the scriptLimits tag, one can increase the default timeout from 15s, so that an application is less likely to trigger the script-running-slowly error.

There's a Windows executable that can be used to add/edit this tag here: http://www.buraks.com/swfsli/ We could use this to find out what changes must be made to the compiled SWF and add the feature as an option to OpenLaszlo by default.


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
P T Withington - 13/Nov/07 12:51 PM
Technical Marketing should weigh in on whether we want to support this (and how it should be supported), since it is a runtime-specific feature (only affects swf).

I should also say that I was always under the impression that Adobe says you should _not_ increase these limits for production code. The default timeout is 15 seconds. If you get this warning, it means your app has not given any user-feedback for 15 seconds. The user is probably pretty annoyed by that point. It was my understanding this feature was so you could _decrease_ the limit for testing, to make sure your app was not close to the limit (and hence might trigger it on a slower machine).

P T Withington - 28/Nov/07 12:12 PM
This is what flasm does:

TAG_SCRIPTLIMITS = 65
void writeScriptLimits(unsigned int recursion, unsigned int timeout)
{
  writeTagHeader(TAG_SCRIPTLIMITS, 4);
  flputShort(recursion);
  flputShort(timeout);
}

I was thinking we should support something like

  #pragma "ScriptLimits(recursion, timeout)"



Antun Karlovac - 29/Nov/07 12:06 PM
Where would the #pragma go? In a <script> block in the canvas?

P T Withington - 29/Nov/07 12:09 PM
That was the plan. Unless someone has a better idea. Henry thought about making it a canvas attribute, but it seemed to me to be too platform-specific for that.

P T Withington - 03/Dec/07 12:55 PM
After looking at this, it will be really messy to implement this as a pragma in a script tag. Is there any objection to using Henry's idea?

P T Withington - 04/Dec/07 01:26 PM
Test case

P T Withington - 04/Dec/07 01:58 PM
From the test case, I observe two things which may be of interest:

1) When the recursion limit is exceeded, the application silently fails (becomes non-responsive).
2) The timeout limit can only be increased to a maximum of 60 seconds.


Antun Karlovac - 04/Dec/07 02:53 PM
Why is the maximum timeout limit 60s? When I used swfsli, I was able to set my timeout to 300s. Is there a reason that you can only go as far as 60? Maybe SWF 7/8 differences?

P T Withington - 04/Dec/07 08:21 PM
I can set the timeout to anything I like, but I still get a "Script Running Slowly" after 60 seconds. Did you actually measure how long you can run before getting the running slowly prompt? Does anyone think that a user is going to patiently sit there for more than a minute without seeing some sort of UI update?

P T Withington - 04/Dec/07 08:23 PM
r7448 | ptw | 2007-12-04 23:23:05 -0500 (Tue, 04 Dec 2007) | 38 lines
Changed paths:
   M /openlaszlo/trunk/WEB-INF/lps/schema/lfc.lzx
   M /openlaszlo/trunk/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/api/ScriptLimits.java
   M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java
   M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java

Change 20071204-ptw-z by ptw@dueling-banjos.local on 2007-12-04 17:04:11 EST
    in /Users/ptw/OpenLaszlo/ringding-2
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Implement scriptlimits for SWF runtime

New Features: The canvas tag has a new attribute, swflimits which is
of type css, which can be used to override the default recursion (256)
and timeout (15s) limits. To do so you say:
  <canvas scriptlimits="timeout: 30">
or to override both limits
  <canvas scriptlimits="recursion: 300; timeout: 30">

Bugs Fixed:

Technical Reviewer: henry.minsky@gmail.com (message://<8c61fad60712041542w5c964533v4f36a1d693b63f72@mail.gmail.com>)
QA Reviewer: antun@laszlosystems.com (pending)
Doc Reviewer: lou@louiorio.com (pending)

Documentation:
See "New Features". For complete example demonstration, see the test
case attached to the bug.

Details:
    schema/lfc: add scriptlimits attribute to canvas

    CanvasCompiler: parse scriptlimits and store in environment

    SWFWriter: Don't try to write scriptlimits immediately. When
    closing the file, if the limits have been set (are non-zero) add
    them.

    ScriptLimits: Correct defaults. If called with a 0 value, use the default.

Tests:
    smokecheck, test case from Jira


Henry Minsky - 05/Dec/07 09:57 AM
r7413 | hqm | 2007-11-29 09:01:34 -0500 (Thu, 29 Nov 2007) | 26 lines
Changed paths:
   A /openlaszlo/trunk/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/api/ScriptLimits.java
   M /openlaszlo/trunk/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/util/Tag.java
   M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java
   M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/ObjectWriter.java
   M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFFile.java
   M /openlaszlo/trunk/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java

Change 20071128-hqm-4 by hqm@DADDY_THNKPAD67 on 2007-11-28 19:58:01 EST
    in /cygdrive/c/users/hqm/openlaszlo/trunk
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: implement script limits tag

New Features:

Bugs Fixed:

Technical Reviewer: ptw
QA Reviewer: (pending)
Doc Reviewer: (pending)

Documentation:

Release Notes:

Details:

implement scriptlimits tag


Tests:


------------------------------------------------------------------------

hqm@DADDY_THNKPAD67 /cygdrive/c/users/hqm/openlaszlo/trunk2

P T Withington - 05/Dec/07 10:53 AM
r7459 | ptw | 2007-12-05 13:52:32 -0500 (Wed, 05 Dec 2007) | 34 lines
Changed paths:
   M /openlaszlo/branches/4.0.5.1
   M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/schema/lzx.rnc
   A /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/api/ScriptLimits.java (from /openlaszlo/trunk/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/api/ScriptLimits.java:7413)
   M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/jgenerator-2.2/src/org/openlaszlo/iv/flash/util/Tag.java
   M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/src/org/openlaszlo/compiler/CanvasCompiler.java
   M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/src/org/openlaszlo/compiler/CompilationEnvironment.java
   M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/src/org/openlaszlo/compiler/ObjectWriter.java
   M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFFile.java
   M /openlaszlo/branches/4.0.5.1/WEB-INF/lps/server/src/org/openlaszlo/compiler/SWFWriter.java
   A /openlaszlo/branches/4.0.5.1/test/lpp-5088.lzx

Change 20071205-ptw-1 by ptw@dueling-banjos.local on 2007-12-05 13:39:29 EST
    in /Users/ptw/OpenLaszlo/4.0.5.1
    for http://svn.openlaszlo.org/openlaszlo/branches/4.0.5.1

Summary: Implement scriptlimits for SWF runtime

New Features: The canvas tag has a new attribute, swflimits which is
of type css, which can be used to override the default recursion (256)
and timeout (15s) limits. To do so you say:
  <canvas scriptlimits="timeout: 30">
or to override both limits
  <canvas scriptlimits="recursion: 300; timeout: 30">

Bugs Fixed:
LPP-5088 'Enable scriptLimits override in Flash'

Technical Reviewer: henry.minsky@gmail.com (message://<8c61fad60712041542w5c964533v4f36a1d693b63f72@mail.gmail.com>)
QA Reviewer: antun@laszlosystems.com (pending)
Doc Reviewer: lou@louiorio.com (pending)

Documentation:
See "New Features". For complete example demonstration, see the test
case attached to the bug.

Details:
    Merged revisions 7413,7448 via svnmerge from
    http://svn.openlaszlo.org/openlaszlo/trunk

    Added test/lpp-5088 to demonstrate the use of the feature

Tests:
    smokecheck, test case


P T Withington - 05/Dec/07 10:55 AM
Note fix in 4.0.5.1

Mamye Kratt - 07/Dec/07 10:56 AM
(4.0.5.1 branch build r7467 - XP, OS X)
(4.0.5.1 branch build r7479 - linux)

-testfile ran successfully in all 3 platforms
-checked release notes
-also opened some applications