Skip to main content
October 5, 2006
Question

application.shutdown changes behaviour of xml.load

  • October 5, 2006
  • 4 replies
  • 558 views
Hi there,

we are using the function "application.shutdown" ( application.shutdown(); ) to clean up a specific instance of an application. After a room has been shutdown and reused again it refused to load external xml-files with xml.load and does not fire the xml.onload event.

The application is basically a chatapplication which has a master-admin who can reset the room. We needed this kind of reset because our server-sided code sometimes crashes. This is our own problem but instead of wasting 100 hours of debugging we made a nice 'reset' button for our admins. The reset-button (in flash) calls a function on the server which executes "application.shutdown()".

After that the application is unloaded and everybody is 'kicked' from the instance. Our chat has an auto-connect method so all people reconnect automatically after 5 seconds. This works fine.

However if you try to load an XML file (file = new XML(); file.onLoad = function () { trace('loaded'); } ; file.load("myurl.xml"); then it FAILS after the room has been shutdown using the command. It works -fine- (for many months) when the instance is started normally.

The only way to fix an 'unstable' instance , for us , is to restart the whole server.

FMS version 2.0.1
Redhat

PS We are aware of the fixes like 2.0.2 and 2.0.3 but they don't make any note about this problem, do they ?
    This topic has been closed for replies.

    4 replies

    November 14, 2006
    Too bad ; the server has crashed multiple times this week with a moderate load of about 250 connections, 2 per user. Each user connects to 2 instances at the same time (a video-application and a chat-application). We've altered jsengine size to 30.000 kb and set 'reuse' to false. Nothing is in the log when the server denies access to anyone when the 'failure' occurs. External files (php scripts that server xml-output) cannot be loaded anymore with xml.load. After a simple restart of the FMS server (using commandline or the FMS console) cures the problem. It doesn't look that it's tcp (stack) related on the Red Hat (Linux) server, nor in our application (the app runs fine, just the .onLoad never gets fire when we use xml.load) ..

    November 8, 2006
    We've altered the configuration-file with these settings and have to wait until it crashes again (or not) .. This happened normally after about 3 days of normal operation. I'll repost if it crashes (within 3 days) or after 5 days if it keeps running smoothly. Thanks again for this information.
    November 7, 2006
    In a project we developed, we had problems with XML loading. It turned out to be a bug in a feature. The connection pooling wasn't working correctly. Connections were opened and added to the pool but never reused. As soon as the server ran out of local ports, the XML.load just failed silently. The solution was to turn off connection pooling.

    I don't know if this is at all applicable to your problem but it's worth mentioning.

    /Johan
    November 7, 2006
    quote:

    Originally posted by: ManMachine
    In a project we developed, we had problems with XML loading. It turned out to be a bug in a feature. The connection pooling wasn't working correctly. Connections were opened and added to the pool but never reused. As soon as the server ran out of local ports, the XML.load just failed silently. The solution was to turn off connection pooling.

    I don't know if this is at all applicable to your problem but it's worth mentioning.

    /Johan


    This might be something and we'll check how many (tcp) ports are in use at certain moments but it doesn't explain why application suddenly stops working when we issue an application.shutdown() on the server-side.

    Thanks for your reply, we appreciate that very much.
    November 6, 2006
    bump. We still have this problem and it doesn't seem to be related to our code. After several days or RIGHT after a shutdown. This behaviour IS random however. We can shutdown a room for 100 times and it will work or it can fail right away after a restart.

    The core of the problem is in the xml.load() function. It doesn't want to load external URL's anymore. We've checked the logfiles of those external servers and they don't show any activity of script being called.

    e.g.

    xml.load(" http://ourserver.com/test.php");

    will NOT work when the server became unstable. It will work when we restart the FMS server but nobody knows for how long.

    We declare a new XML() object for each client.

    The connection between the FMS server and the external server is not limited by a firewall.

    Maybe Adobe could post a comment on this behaviour ?
    November 6, 2006
    Ok, let me summarize what you're saying (before I go ahead and try to reproduce this in the "ideal" world

    In a scenario, where
    1. onAppStart a xml file is being loaded using xml.load and
    2. the application is being shutdown using application.shutdown
    3. the xml.load does not work anymore after the application has been shut down once.
    If this is true, it should be quite easy to replicate. What's your exact build (quickest is to get it from the header in the log files) and the OS you're running on?

    Another thing I would like to know (for a 'plan B' ) what made you implement this application.shutdown solution? What was the error message you saw on the server and clients when your server-side code "crashed"?
    What's your JSENGINE size (in application.xml)?
    November 6, 2006
    quote:

    Originally posted by: mm_patrick
    Ok, let me summarize what you're saying (before I go ahead and try to reproduce this in the "ideal" world

    In a scenario, where
    1. onAppStart a xml file is being loaded using xml.load and
    2. the application is being shutdown using application.shutdown
    3. the xml.load does not work anymore after the application has been shut down once.
    If this is true, it should be quite easy to replicate. What's your exact build (quickest is to get it from the header in the log files) and the OS you're running on?

    Another thing I would like to know (for a 'plan B' ) what made you implement this application.shutdown solution? What was the error message you saw on the server and clients when your server-side code "crashed"?
    What's your JSENGINE size (in application.xml)?



    Little correction -> 1. we load an XML file using xml.load on every onConnect

    Version:

    #Version: 1.0
    #Start-Date: 2006-11-06 10:36:22
    #Software: Macromedia Flash Media Server 2.0.1 r27
    #Date: 2006-11-06


    OS ; Linux, Red Hat, Kernel 2.4.21-27EH
    Pentium 4, 3 Ghz
    4 Gb of ram, of which 3.2 Gb is buffered

    command: free
    total used free shared buffers cached
    Mem: 3596388 3543512 52876 0 136692 3248828
    -/+ buffers/cache: 157992 3438396
    Swap: 2040244 0 2040244

    command: w
    20:36:16 up 91 days, 5:05, 1 user, load average: 0.00, 0.00, 0.00

    JSENGINE:
    <RuntimeSize>1024</RuntimeSize>
    <MaxTimeOut>0</MaxTimeOut>


    The application on this server (we have 3 identical physical servers and licenses) is still in test-phase due to this 'bug'.

    We haven't upgraded to 2.0.2 or 2.0.3 since ppl have been writing on forums that their license-user-limit isn't working correctly. If you need any more information please let me know.