We are moving to Git Issues for bug tracking in future releases. During transition, content will be in both tools. If you'd like to file a new bug, please create an issue.

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

See Also:
Version Reported In:
Also Affects:


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:


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:

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
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
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...
Comment 10 Alec Smecher 2014-05-07 12:02:03 PDT
APC shutdown function ported to OCS
Comment 11 Alec Smecher 2014-05-07 12:03:03 PDT
Submodule update for APC fix