[ic] $::Control leaking between pages? (was: Data appearing from different catalog)
Mike Heins
mikeh at endpoint.com
Sun Apr 3 18:50:03 UTC 2016
Quoting Mike Heins (mikeh at endpoint.com):
> Quoting Peter (peter at pajamian.dhs.org):
> > On 03/04/16 12:25, Peter wrote:
> > > This sounds like $::Control is leaking between page requests, are you
> > > running Interchange in RPC traffic mode (as set in interchange.cfg)?
> >
> > Just for a bit of explanation here, when you run Interchange in RPC
> > traffic mode child processes are recycled to serve up multiple page
> > requests. In doing so certain variables have to be explicitly cleared
> > for each page request or they can pick up values from previous pages
> > which set those variables. This is done in the reset_vars() sub in
> > Server.pm.
> >
> > What I think is happening is that $::Control is not reset in this
> > process, and is picking up values from previous pages that were served
> > by the same child process. This would be a bug in Interchange if this
> > is the case and needs to be fixed.
>
> I think this would be possible in the case of a new session,
> not otherwise.
>
> Probably we should set $::Control as part of init_session.
Actually, this should happen in Vend::Server::reset_vars(), and I have
done that. If you apply this patch:
diff --git a/lib/Vend/Server.pm b/lib/Vend/Server.pm
index e31c8f9..52855b3 100644
--- a/lib/Vend/Server.pm
+++ b/lib/Vend/Server.pm
@@ -1240,6 +1240,7 @@ sub reset_vars {
package CGI;
reset 'A-Z';
reset 'a-z';
+ undef $::Control;
undef %Vend::Table::DBI::DBI_connect_cache;
undef %Vend::Table::DBI::DBI_connect_bad;
undef %Vend::Table::DBI::DBI_connect_count;
It should remove the problem. I have committed this to the repository.
--
Mike Heins
End Point -- Expert Internet Consulting http://www.endpoint.com/
phone +1.765.253.4194 <mikeh at endpoint.com>
There is something fascinating about science. One gets such wholesale
returns of conjecture out of such a trifling investment of fact.
-- Mark Twain
More information about the interchange-users
mailing list