Bug 8151 - Investigate APC bug workaround
Investigate APC bug workaround
Status: RESOLVED FIXED
Product: OJS
Classification: Unclassified
Component: General
2.4.3
All All
: P3 normal
Assigned To: PKP Support
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-07 16:33 PST by Alec Smecher
Modified: 2013-11-12 13:20 PST (History)
3 users (show)

See Also:
Version Reported In:
Also Affects:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alec Smecher 2013-03-07 16:33:02 PST
The APC bug that's been reported a few times in the forum apparently has a PHP-space workaround:

https://bugs.php.net/bug.php?id=58739

Investigate and implement if it's easy to do.
Comment 1 Michael Thessel 2013-03-19 11:22:22 PDT
Is there any more info available? In the forum I found the following threads:
http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=7044
http://pkp.sfu.ca/support/forum/viewtopic.php?f=3&t=8731
http://pkp.sfu.ca/support/forum/viewtopic.php?f=8&t=4999

From the bug reports I can see that people reported the problem for APC 3.0.19 - 3.1.10 with PHP 5.2 and 5.3. Latest APC is 3.1.12. None of the reported bugs are marked as fixed. The changelog for 3.1.11 and 3.1.12 doesn't mention any fixes related to this problem either.

The proposed PHP space solution from the bug report is to register session_write_close() as a shutdown function. I guess we cold detect if APC is in use and if this is the case register the shutdown function. We could add to the bootstrapping process as part of pkp-lib (classes/core/PKPApplication.inc.php).

Does this work for you?
Comment 2 Alec Smecher 2013-03-19 11:29:23 PDT
You're on the right track, Michael; I think the conversation involving Rasmus & co. basically says that we ought to be calling session_write_close anyway, but it's only the presence of APC that actually makes it a problem. I'd suggest calling session_write_close regardless of whether APC is present.
Comment 3 Michael Thessel 2013-03-21 10:13:47 PDT
Added the shutdown function to the SessionManager in pkp-lib. I only tested if it has any general side effects. If you want I can change my setup to run with APC and try to reproduce the bug in OJS which would be a bit of an effort though.
Comment 4 Michael Thessel 2013-03-21 12:25:02 PDT
Added session_write_close as a shutdown function
https://github.com/pkp/pkp-lib/commit/8fda4d6c6facaac21afac4bd3e76ef2a4a8b7f2b
Comment 5 Alec Smecher 2013-03-21 12:26:01 PDT
Looks perfect, though we'll have to wait for feedback from someone using APC; thanks, Michael.
Comment 6 Alec Smecher 2013-03-21 12:30:02 PDT
Added session_write_close as a shutdown function
https://github.com/pkp/pkp-lib/commit/db686c70c887d952ccfbb2d038bc4f56a786b278
Comment 7 AN support 2013-09-24 10:30:48 PDT
This is listed in http://pkp.sfu.ca/wiki/index.php?title=OJS_2.4.2_Recommended_Patches
but fails with 2.4.2 [no classes/session directory...]
Comment 8 Alec Smecher 2013-09-24 10:54:37 PDT
AN Support, apply this patch from within the lib/pkp subdirectory. It applies to the PKP library, which is distributed with OJS.
Comment 9 AN support 2013-09-24 11:46:31 PDT
Thanks, indeed I failed to look for it below...