SessionManager: Ignore Session object destruction during global shutdown
commitf1a751db941558b7a480730cb6e009bc227784ef
authorBrad Jorsch <bjorsch@wikimedia.org>
Wed, 20 Apr 2016 16:27:26 +0000 (20 12:27 -0400)
committerBrad Jorsch <bjorsch@wikimedia.org>
Wed, 20 Apr 2016 17:16:40 +0000 (20 13:16 -0400)
tree6777aff423f9a7756c570069a4b70a16bab4ccb7
parentd1c0589f6d17419991648f60dffaf8c762df69fc
SessionManager: Ignore Session object destruction during global shutdown

We already save all open SessionBackends when shutdown handlers are run,
which *should* make the Session object destructors that run during
global shutdown not have anything to save. But it can get fooled if the
Session data contains other objects that have already gotten destroyed
during the global shutdown, leading to spurious warnings and errors as
it tries to access partically-destroyed objects.

The solution is to set a flag when we do the shutdown handlers and just
ignore the last gasps from Session::__destruct() that might come after.

Change-Id: Ic3eb0bac2d29a30488c84b6525ad796a7f1c9ce9
includes/session/SessionBackend.php
includes/session/SessionManager.php
tests/phpunit/includes/session/SessionManagerTest.php