LABKEY.WebPart.render() times out

LabKey Support Forum (Inactive)
LABKEY.WebPart.render() times out Leo Dashevskiy  2013-02-06 22:04
Status: Closed
 
Hello folks!

I am making a .render() call on a LABKEY.WebPart object from my JS code and the back-end R code takes a while to run and return something. My LABKEY.WebPart gives me a time-out exactly 5 minutes after I make the .render() call, but I need more.

By the way, I already did have some timeout issue before elsewhere and so I did set "Ext.Ajax.timeout = 3600000;" in a global setting in a piece of code that should have been imported way before the .render() call above. The value above is an hour and I was under the impression (from dealing with that other issue) that it is being respected...

Any thoughts on how can I extend/avoid this time out?

Thanks.
-Leo
 
 
Nick Kerr responded:  2013-02-06 23:11
Hey,

Our default timeout is 5 minutes as you say.

Simple thing, but might you be making the request using Ext4?

Ext4.Ajax.timeout = 3600000;

Thanks,
Nick
 
Leo Dashevskiy responded:  2013-02-07 11:35
Interesting point, Nick.

But I am not relying on Ext4 anywhere - I do not even have the LABKEY.requiresExt4ClientAPI() call yet...

And it would be weird for LABKEY.WebPart in its render() call to have switched from relying on Ext(3) to relying instead on Ext4

The thing that is different now from before is the usage of Rserve backend instead of pure R...
 
Leo Dashevskiy responded:  2013-02-07 18:09
Ok, so I have been setting the timeout globally in hopes that it would be universal for all of the Ajax calls, but if I look at Ext.Ajax.timeout's value within the LABKEY.ExtAdapter.Ajax.request() method before anything happens there, it is changed back to default 300000. What is the proper way of setting it then? Can it be passed into the render() call of a LABKEY.WebPart ?
Please, advise!
 
Leo Dashevskiy responded:  2013-02-11 10:44
Looking at the debugging print statements, seems that the time out setting in the ext-patches.js happens before my custom one:

"default set ajax timout to: 300000 ext-patches.js:12
custom set ajax timout to: 3600000 OpenCyto.js:34"

Moreover, the loading of the corresponding scripts does appear to proceed in the correct order from looking in the generated html code:

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <title>Flow Dashboard: /HVTN080</title>
    <!-- http://140.107.157.39:8080/labkey/project/HVTN080/begin.view?.lastFilter=true -->
    <!-- <base href="http://140.107.157.39:8080/labkey/project/HVTN080/" /> -->
<link rel="canonical" href="http://140.107.157.39:8080/labkey/project/HVTN080/begin.view?">
...
    <script type="text/javascript">
        LABKEY.loadedScripts('ext-3.4.0/adapter/ext/ext-base-debug.js','ext-3.4.0/ext-all-debug.js','ext-3.4.0/ext-patches.js', ... ,'OpenCyto/OpenCyto.js', ...);
    </script>
    <script src="/labkey/ext-3.4.0/adapter/ext/ext-base-debug.js?2138056540" type="text/javascript"></script>
    <script src="/labkey/ext-3.4.0/ext-all-debug.js?2138056540" type="text/javascript"></script>
    <script src="/labkey/ext-3.4.0/ext-patches.js?2138056540" type="text/javascript"></script>
...
</head>


<body ...>
    ...
    <script src="/labkey/OpenCyto/OpenCyto.js?2138056540" type="text/javascript"></script>
...
</body>


So not sure, what's going on here and why LABKEY.ExtAdapter.Ajax.request() no longer respects the custom override of the Ext.Ajax.timeout value...

Any help is appreciated!
(For now for my purposes I will modify the ext-patches.js but that would not work well for production environment since regular user would not be expected to modify the global scripts like that, right?)

Thanks.
-Leo
 
Leo Dashevskiy responded:  2013-02-11 12:44
To my surprise overwriting the value in ext-patches.js did not help either!

I started digging further and just noticed that the inner request() method (of LABKEY.ExtAdapter.Ajax) is part of Ext.data.Connection definition, which itself is in a file called ext-all-sandbox-debug.js (that has the header: "This file is part of Ext JS 4.1").

So looks like Nick was absolutely right indeed and I just did not understand correctly: even though, I am not using any of the Ext4 client API yet, this request() method above was changed (since I set my timeout value) to rely on Ext4, instead of Ext3, I guess, it is not part of the exposed API; moreover simply "Ext" in the context of that request() method seems to be the alias for "Ext4" and not noticing that first confused me.

The bottom line is, setting Ext4.Ajax.timeout does the trick...