perl-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <torsten.foert...@gmx.net>
Subject Re: [PATCH] please review: interpreter allocation
Date Wed, 26 Sep 2007 11:08:32 GMT
On Tuesday 25 September 2007 15:52, Torsten Foertsch wrote:
> It may have flaws with other resources. For example
> I think pnotes need to be dropped whenever an interpreter is freed. I still
> have to check that.

This is an update to the yesterday patch. It cures a problem that occurred to 
me last night.

In modperl_callback_run_handlers() there is this comment:

-    /* XXX: would like to do this in modperl_hook_create_request()
-     * but modperl_interp_select() is what figures out if
-     * PerlInterpScope eq handler, in which case we do not register
-     * a cleanup.  modperl_hook_create_request() is also currently always
-     * run even if modperl isn't handling any part of the request
-     */
-    modperl_config_req_cleanup_register(r, rcfg);

This is the place where the function that calls a PerlCleanupHandler is 
registered. It occurred to me that modperl_callback_run_handlers() is called 
only if at least one Perl*Handler is called in the request cycle. So a 
PerlCleanupHandler cannot be called unless there is an other Perl*Handler 
previously called in the same request cycle.

On top of the interpreter allocation patch it is very easy to fix that. Simply 
do what the comment suggests.

The attached "x" adds a test case for the bug.

The attached trunk-threads.patch contains the fix plus the test case.

Torsten

Mime
View raw message