YUI ajax request timeout override(share/proxy/alfresco call)

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-03-2011 12:39 PM
Hi,
I'm developing a Share dashlet which waits for user to fill in the form and then emails a lot of other users. Now, I'm doing the emailing part via a webscript, and I'm trying to get this webscript to work through an Ajax call. There are a lot of users in this group and the mail server isn't the fastest in the world (shared hosting server) So the mailing takes a bit, about 2-3 minutes.
The webscript completes its task, but I cannot get a result on the Share side and show it to the user. The script still finishes the job, but I don't get info. Tried different browsers. Tried setting the timeout to more and to null and avoid it completely.
Now, an interesting point, I tried calling directly in the browser:
This worked!
But via proxy:
Can somebody tell me what setting should I look for/change? How can I do this differently?
I'm developing a Share dashlet which waits for user to fill in the form and then emails a lot of other users. Now, I'm doing the emailing part via a webscript, and I'm trying to get this webscript to work through an Ajax call. There are a lot of users in this group and the mail server isn't the fastest in the world (shared hosting server) So the mailing takes a bit, about 2-3 minutes.
Alfresco.util.Ajax.request({ url: url, method: "GET", responseContentType: JSON, timeout:null, // tried varying this in many ways successCallback: { fn:this.mailSent, scope: this }, successMessage: "Sent", failureCallback: "Failed sending" });
Now, my problem is that the requests always timeout at 90 seconds. The webscript completes its task, but I cannot get a result on the Share side and show it to the user. The script still finishes the job, but I don't get info. Tried different browsers. Tried setting the timeout to more and to null and avoid it completely.
Now, an interesting point, I tried calling directly in the browser:
http://192.168.254.21:8888/alfresco/service/pbk/mail-announcement?id=200859
This worked!
But via proxy:
http://192.168.254.21:8888/share/proxy/alfresco/pbk/mail-announcement?id=200857
it timeouts (ie. empty response after exactly 90 seconds).Can somebody tell me what setting should I look for/change? How can I do this differently?
Labels:
- Labels:
-
Archive
6 REPLIES 6

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2011 11:39 AM
For what it's worth (and for future unhappy user stumbling on this thread, I've found out where this timeout is set.
It's hardcoded in RemoteClient class in spring webscripts framework (/org/springframework/extensions/webscripts/connector/RemoteClient.java):
Hopefully somebody else won't stumble on this too.
It's hardcoded in RemoteClient class in spring webscripts framework (/org/springframework/extensions/webscripts/connector/RemoteClient.java):
private static final int CONNECT_TIMEOUT = 5000; // 5 seconds private static final int READ_TIMEOUT = 180000; // 90 seconds
Hopefully somebody else won't stumble on this too.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2011 04:16 AM
This issue has been raised in JIRA (https://issues.alfresco.com/jira/browse/ALF-10737). Hopefully we'll get the opportunity to make this update… although as it's technically an improvement rather than a bug it's not on our immediate priority list unfortunately.
Regards,
Dave
Regards,
Dave

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2011 05:04 AM
Yes, thanks for the link. I forgot to include it. (Well, not forgot, the thought that I should didn't even cross my slow mind
).

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2011 05:10 AM
In case you've not seen it… that issue (https://issues.alfresco.com/jira/browse/ALF-10737) and committed to the Alfresco community source code. It's now possible to configure the timeout on the RemoteClient via it's Spring bean configuration - both the linked issue and the configuration file contain information on how to do this.
Regards,
Dave
Regards,
Dave

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2011 05:25 AM
Yes, I know. But we're on 3.4 version with no immediate plans for upgrade. And the comments in that issue only says that it "could" be backported to 3.4.x.
Thanks any way.
Thanks any way.

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2011 06:19 AM
I'm sure we'll be able to back port that to the next open 3.4.X bug fix codeline which is 3.4.8.
Thanks,
Kev
Thanks,
Kev
