Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthorhaakon

    I was trying to create a comet system in akelos, where the browser is set to send a ajax request in the background, while the page is done loading.
    This request is then set on hold on the webserver, until something useful has happened.

    The system works fine by running the php code in CLI, but as soon as I use Akelos, it seems like Akelos is waiting for the other serverchild to complete before the new request is done.

    Has Akelos some kind of internal wait-queue if two requests on the same session id is made? Because I can open phpmyadmin on the same host, but not another akelos page.

    • CommentAuthordale
    I have run into a similar problem. I believe the issue is in using the php session. Akelos opens a session early on with phps session_start() (if you have AK_AUTOMATIC_SESSION_START set). In php this then locks the session for writing. All future requests coming in will stall on the session_start() call until the session is unlocked. We solved this by calling $this->_closeSession(); in the controllers that had long running actions. In the end we actually decided that we're not using the session for much so we moved all of our session usage into a beforeFilter in application_controller.php and then called $this->_closeSession(); when we were done. This way the session is closed prior to executing any action code in our application. This, of course limits us to not writing to the browser session within actions but we store most of the session related stuff in the db anyway so it hasn't hindered us yet.

    I'm not certain this is the best way to handle the issue but it's how we've dealt with it so far. If anyone else has other thoughts I'd love to hear them.

    • CommentAuthorhaakon
    Thanks. I was actually not aware that PHP did block in the session_start(). I thought this was something Akelos specific.

    Thanks for the tip. I have it up and working now!
    I just need to be sure never to let the same session have two of these constant ajax connections, since many browsers only use at max 2 connections for each server. :/
    Which would render the page unusable, because of the two pending requests.