You are viewing a plain text version of this content. The canonical link for it is here.
Posted to embperl@perl.apache.org by Ragnar Hakonarson <rh...@conquestnetwork.com> on 2000/05/10 16:12:03 UTC

problems with %udat persistance

Dear all,

I use embperl's sessions management with mySQL under Suse Linux. I am
experiencing non deterministic behaviour from embperl's session management
as %udat does not always store or retrieve data appropriately. I use IE5 and
I have it configured to check for newer versions of stored pages on every
visit to the page. I retrieve some page successfully, then I try to fetch it
again and it fails. The rate of failure varies. I really do not know whether
it is indeed embperl that is causing the failure or, if it might be the
Apache web server or mySQL that is causing it.

I operate the web server (Apache) on a LAN (ethernet).

It is worth mentioning that the graphics on my pages do not them either
always load, although it rarely happens. That could indicate that embperl's
session management is working and that the browser or web server fails to
send data successfully between themselves.

Furthermore, I always access %udat 'directly' on every page to enable the
session management to detect change.

I have the feeling that there is some time out occurring somewhere in the
process. Whether it is emberl, mySQL, Apache, or even the browser, that is
causing the problem I do not know.

Does anyone have a clue?

Please see my configuration files below.

regards
ragnar

------------- startup.pl --------------
#!/usr/bin/perl

BEGIN {
  use Apache ();
  use lib Apache->server_root_relative('lib/perl');
  unshift (@INC, "/caseTracking/packages");
}

use Apache::Registry();
use Apache::Status;
use Apache::DBI;
use Apache::AuthDBI;
use DBI;
use Apache::Constants();
use CGI qw(-compile :all);
use CGI::Carp();
use LWP();
use Apache::Session();
use Apache::TicketAccess();
use Apache::SubTicketAccess();
use Storable;

$ENV{TRACE_LEVEL}=3;
$ENV{TRACE_FILE_NAME}="/caseTracking/logs/dbTraceLog";
$ENV{EMBPERL_SESSION_CLASSES} = "DBIStore SysVSemaphoreLocker";
$ENV{EMBPERL_SESSION_ARGS} = "DataSource=dbi:mysql:session UserName=clm";



  $Apache::DBI::DEBUG=2;
  $Apache::Session::SysVSemaphoreLocker::nsems = 32;

# -- Access directives for 'protected' area --
  Apache::SubTicketAccess->configure('protected', {
	TicketDB		=> 'dbi:Pg(AutoCommit=>0):dbname=transactiondb',
	TicketDBUser		=> 'clm',
	TicketUserTable       	=> 'users:username:passwd',
	TicketTable           	=> 'tickets:ticket_hash:expires',
	TicketSecretTable     	=> 'ticketsecrets:sec_data:sec_version',
	TicketDomain          	=> '.conquestnetwork.com',
	TicketPath            	=> '/protected',
	TicketSecure          	=>  0,
	TicketLoginForm       	=> '/loginform',
	TicketLoginScript     	=> '/login',
	TicketExpires         	=> 30,
	TicketLogoutURI		=> '/logout.html',
  	TicketDefaultPage	=> '/home.epl',
  });

1;




------------- perl.conf ---------------

PerlRequire		conf/startup.pl
PerlFreshRestart	On

# SetEnv DBI_DSN "Pg"

<location /hello/world>
SetHandler perl-script
PerlHandler Apache::Hello
</location>

alias /perl/ /caseTracking/www/perl/

<location /perl>
SetHandler		perl-script
PerlHandler		Apache::Registry
PerlSendHeader	On
Options		+ExecCGI
</location>

SetEnv EMBPERL_DEBUG 270352
 SetEnv EMBPERL_VIRTLOG /embperl/log
 SetEnv EMBPERL_COOKIE_NAME CONQUEST_UID
  #SetEnv EMBPERL_DEBUG 3170492
# SetEnv EMBPERL_COOKIE_EXPIRES 01/01/2100
# SetEnv EMBPERL_OPTIONS 262144

<location /embperl/log>
SetHandler perl-script
PerlHandler HTML::Embperl
Options  execcgi
</location>

<files *.epl>
SetHandler            perl-script
PerlHandler		HTML::Embperl
Options		+ExecCGI
</files>

AddType text/html .epl



# Access directives
<location /protected>
PerlAccessHandler	Apache::SubTicketAccess->authenticate
PerlSetVar		TicketRealm protected
</location>

<location /loginform>
SetHandler		perl-script
PerlHandler		Apache::SubTicketAccess->login_form
PerlSetVar            	TicketRealm protected
</location>

<location /login>
SetHandler            perl-script
PerlHandler           Apache::SubTicketAccess->login
PerlSetVar            TicketRealm protected
</location>

<location /protected/logout>
SetHandler		perl-script
PerlHandler           Apache::SubTicketAccess->logout
PerlSetVar            TicketRealm protected
</location>

# Enable Status support
<Location /server-status>
setHandler	server-status
order		deny,allow
deny from 	all
allow from	localhost, 192.168.0.44
allow from	192.168.0.150
</Location>

ExtendedStatus  on


RE: problems with %udat persistance

Posted by Gerald Richter <ri...@ecos.de>.
> That leaves us with the SysVSemaphoreLocker mechanism as
> the prime suspect, or?
>

I also use mysql as session database on a Linux system and it works without
problems..., but from what you describe it really looks like a Locker
problem, so I would first try to use NullLocker instead of
SysVSemaphoreLocker. Has your system many page requests or is it just a test
system?

> Am I completely on the wrong track?
>

No, surely not

Gerald
-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------


RE: problems with %udat persistance

Posted by Ragnar Hakonarson <rh...@conquestnetwork.com>.
Dear Gerald,

Thanks for your quick response.

Cookies are being received and sent by the browser correctly. I am using a
cookie based login facility that works without any problems. Furthermore,
when reading the embperl debug file I see that the embperl session cookie id
is received by embperl from the browser, always.

I have detected that when embperl receives the session id that changes do
not get updated in the session database. Could the problem have anything to
do with the $Apache::Session::SysVSemaphoreLocker::nsems variable or the
mechanism related with it?

When I fetch a page and %udat is not correctly updated, or even not
containing any older data, I have to wait for some time before successfully
re-fetching the page with %udat responding correctly as opposed to
re-fetching the page instantly on failure. However, this is not 'always' the
case. Could it be that the SysVSemaphoreLocker mechanism is blocking access
to the row containing the data for the session id in question?

I suspect that the problem does not lie with embperl nor the browser. I
think the problem might be related with the persistence mechanism that
embperl uses. I always successfully retrieve database resources through DBI
(PostgreSQL) within my pages so I have a high degree of confidence with DBI.
Another point worth mentioning is that the session database is mySQL while
all other database resources through out the system are located in
PostgreSQL. For instance, the cookie based login mechanism I am using stores
it's cookie data in PostgreSQL and it never fails. I find it hard to believe
that mySQL is causing the problem as it seems to be used by many as the
session database. That leaves us with the SysVSemaphoreLocker mechanism as
the prime suspect, or?

Am I completely on the wrong track?

I am puzzled.

regards,
ragnar



-----Original Message-----
From: Gerald Richter [mailto:richter@ecos.de]
Sent: 10 May 2000 18:57
To: Ragnar Hakonarson; embperl@perl.apache.org
Cc: steini@conquestnetwork.com
Subject: RE: problems with %udat persistance


>
> I use embperl's sessions management with mySQL under Suse Linux. I am
> experiencing non deterministic behaviour from embperl's session management
> as %udat does not always store or retrieve data appropriately. I
> use IE5

As Vladimir told us, early version of IE 5 have problems with cookie. So it
could be that's an IE 5 problem. Could you try to upgrade your IE 5 or test
it with Netscape?

You can also enable the dbgHeadersIn flag in EMBPERL_DEBUG and take a look
at the embperl logfile. You should see the cookie with the session id for
every request in the http headers your browser send. Are the session id
correctly send by the browser?

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------



RE: problems with %udat persistance

Posted by Gerald Richter <ri...@ecos.de>.
>
> I use embperl's sessions management with mySQL under Suse Linux. I am
> experiencing non deterministic behaviour from embperl's session management
> as %udat does not always store or retrieve data appropriately. I
> use IE5

As Vladimir told us, early version of IE 5 have problems with cookie. So it
could be that's an IE 5 problem. Could you try to upgrade your IE 5 or test
it with Netscape?

You can also enable the dbgHeadersIn flag in EMBPERL_DEBUG and take a look
at the embperl logfile. You should see the cookie with the session id for
every request in the http headers your browser send. Are the session id
correctly send by the browser?

Gerald

-------------------------------------------------------------
Gerald Richter    ecos electronic communication services gmbh
Internetconnect * Webserver/-design/-datenbanken * Consulting

Post:       Tulpenstrasse 5         D-55276 Dienheim b. Mainz
E-Mail:     richter@ecos.de         Voice:    +49 6133 925151
WWW:        http://www.ecos.de      Fax:      +49 6133 925152
-------------------------------------------------------------