From 9de9ed837ec6181bb1de011156f7c6cef44c58f5 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 7 Sep 2010 02:26:38 -0600 Subject: [PATCH] Ticket #7422: Test out session close/reopen for potentially long operations --- imp/lib/Ajax/Application.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/imp/lib/Ajax/Application.php b/imp/lib/Ajax/Application.php index b72b92a7d..9fbed6763 100644 --- a/imp/lib/Ajax/Application.php +++ b/imp/lib/Ajax/Application.php @@ -1930,6 +1930,10 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application */ protected function _viewPortData($change) { + // Ticket #7422: Listing messages may be a long-running operation, + // so close the session while we are doing it to prevent deadlocks. + session_write_close(); + $args = array( 'applyfilter' => $this->_vars->applyfilter, 'cache' => $this->_vars->cache, @@ -1969,7 +1973,12 @@ class IMP_Ajax_Application extends Horde_Core_Ajax_Application } $list_msg = new IMP_Views_ListMessages(); - return $list_msg->listMessages($args); + $msgs = $list_msg->listMessages($args); + + // Reopen the session. + session_start(); + + return $msgs; } /** -- 2.11.0