In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
1339 [In-Portal CMS] Data Management bug report always 2012-07-09 10:45 2012-07-25 05:29
alex  
alex  
normal  
closed 5.0.0  
fixed  
 
none 5.2.0  
https://groups.google.com/d/topic/in-portal-dev/LKCfRhutepY/discussion
Fixing page load delay because of long running scheduled task
1
0001339: Long running scheduled task delays page loading
Administrator can set scheduled tasks to be executed:
* in cron;
* after page load.

In later case long running scheduled task delays actual page content from being sent to user, who requested a page.

To solve this we need to place following code after page content has been sent to user (but before scheduled task execution is started):

ignore_user_abort(true);

while ( ob_get_level() ) {
    ob_end_clean();
}

header('Connection: close');
// header('Content-Length: 0'); // only uncomment when such header isn't sent already
flush();

This code will do following:
1. web browser "Loading ..." indicator should show 100%
2. connection to webserver will be terminated
3. reset of the script will continue to execute on the server
related to 0001191closed  (5.2.0)alex Remove RunMode from Scheduled Tasks 
parent of 0001356closed  (5.2.0)alex Enable output compression by default 
parent of 0001380resolved  (5.2.1)alex Notice on every page with debugger 
related to 0000981closed  (5.2.0)Dmitry Rename Agents section to "Scheduled Tasks" 
related to 0001340closed  (5.2.0)alex Don't use session in scheduled tasks 
related to 0001341closed  (5.2.0)alex Create cron-like interface for scheduled tasks 
patch cron_close_connection_early.patch (1,353) 2012-07-17 09:50
http://tracker.in-portal.org/file_download.php?file_id=1757&type=bug
Issue History
2012-08-20 08:54 alex Relationship added parent of 0001380
2012-07-25 05:29 alex Note Added: 0004832
2012-07-25 05:29 alex Status resolved => closed
2012-07-17 09:59 alex Relationship added parent of 0001356
2012-07-17 09:54 alex Note Added: 0004795
2012-07-17 09:54 alex Status reviewed and tested => resolved
2012-07-17 09:54 alex Fixed in Version => 5.2.0
2012-07-17 09:54 alex Resolution open => fixed
2012-07-17 09:54 alex Assigned To !COMMUNITY => alex
2012-07-17 09:54 alex Changeset attached 5.2.x r15457
2012-07-17 09:51 alex Note Added: 0004794
2012-07-17 09:51 alex Status needs testing => reviewed and tested
2012-07-17 09:51 alex Assigned To => !COMMUNITY
2012-07-17 09:51 alex Developer => alex
2012-07-17 09:51 alex Status active => needs testing
2012-07-17 09:50 alex File Added: cron_close_connection_early.patch
2012-07-09 11:10 alex Relationship added related to 0001341
2012-07-09 11:03 alex Relationship added related to 0001340
2012-07-09 10:51 alex Relationship added related to 0000981
2012-07-09 10:50 alex Relationship added related to 0001191
2012-07-09 10:48 alex Description Updated bug_revision_view_page.php?rev_id=1023#r1023
2012-07-09 10:45 alex New Issue
2012-07-09 10:45 alex Reference => https://groups.google.com/d/topic/in-portal-dev/LKCfRhutepY/discussion
2012-07-09 10:45 alex Change Log Message => Fixing page load delay because of long running scheduled task
2012-07-09 10:45 alex Estimate Points => 1

Notes
(0004794)
alex   
2012-07-17 09:51   
Will test all together later.
(0004795)
alex   
2012-07-17 09:54   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0001339: Long running scheduled task delays page loading
(0004832)
alex   
2012-07-25 05:29   
Since 5.2.0 version was released.