• Resolved thesun1

    (@thesun1)


    Hi,

    I’ve activated the native php sessions plugin and I can see a bunch of stack traces in my logs.

    Stack trace:
    [internal function]: _pantheon_session_write(‘a4f007b29c66f3f…’, ”)
    #1 /app/app/wp-includes/class-wp-hook.php(296): session_write_close()
    #2 /app/app/wp-includes/class-wp-hook.php(323): WP_Hook->apply_filters(NULL, Array)
    #3 /app/app/wp-includes/plugin.php(453): WP_Hook->do_action(Array)
    #4 /app/app/wp-includes/load.php(677): do_action(‘shutdown’)
    #5 [internal function]: shutdown_action_hook()
    #6 {main}

    For these calls the database contains a row in wp_pantheon_sessions with id, secure_session id set, ip_address empty, datetime and data being NULL.

    It doesn’t affect all sessions though since I also see entries with ip, datetime and data.

    Any idea why this would be happening?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    No immediate ideas, unfortunately. The first thought that comes to mind is that something is invalid about the data you’re trying to write.

    Can you share the exception itself? The stack trace doesn’t indicate it.

    Thread Starter thesun1

    (@thesun1)

    Thanks for the quick reply. Took some time to debug this.

    Turns out that
    $session->set_data( $value );
    crashed in the _pantheon_session_write method.

    Why?
    The session create method above it returned false and you can’t call set_data on false.
    At least that was my explanation.

    Root cause that I fixed now:
    I had a db query cache and wp_pantheon_sessions wasn’t added as an exception. So it did not load a session that had been stored in there milliseconds before in the create session method.

    Learning:
    Do not cache a sessions table

    Suggestion:
    Please log a warning or an error when session can’t be created and do not use this “fake” session.

    Plugin Author Daniel Bachhuber

    (@danielbachhuber)

    Please log a warning or an error when session can’t be created and do not use this “fake” session.

    Good suggestion. I’ll tag a v0.6.4 with this change.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Crash on session_write_close()’ is closed to new replies.