So been doing some more digging. It seems the below may be a red-herring

What I have noticed is that occasionally the session cookie is reset. We use a 
very basic method of detecting the session

if(not defined session('last_activity')){
xxx

I noticed a call with a request session id and a different response session id. 
Since we use YAML sessions, I was able to inspect the request session and say a 
valid entry for the last_activity. So its almost as though the session does not 
always load?

Z

From: dancer-users <dancer-users-boun...@dancer.pm> On Behalf Of Zahir Lalani
Sent: 21 March 2019 13:31
To: dancer-users@dancer.pm
Subject: [dancer-users] potential memory leak?

Hi All

We have a weird issue and suspect its possibly a memory leak. I need some 
guidance as to how to debug this and solve it.

We use Dancer2 and Starman, fronted by Apache

Use Case:
We have an image gallery where the user can browse images based on a variety of 
criteria. The gallery is page driven, and the user navigates using 
previous/next buttons. Each page displays 36 images.
Although starman handles all routes, it does not handle the delivery of the 
images. We use an apache module called xsend which offloads the delivery to 
apache and allows starman to focus on data queries.
We find that for certain clients who use the gallery heavily, after many page 
navigations some of the images on the page cause 302's and loses the session, 
so the user has to login again. We can run the image route in another browser 
session and its fine.
The "break" does not happen at a consistent place.

The code that does xsend relies on "halt" as follows:

Sub send_the_file{
# do the queries to get the image details and physical path

# now make the xsend request:
               header('Content-Type' => $mime);
               header("X-Sendfile" => $file);
               header('Content-Disposition' => "inline; 
filename=\"".encode_utf8($file_name)."\";");

               debug('halting for xsend');
               halt('xsend');
}

This method is called through multiple code layers. From what I can tell, halt 
replace return, but it also says that it stops processing at the point of halt. 
We have been looking through logs and cannot see anything specific apart from 
the 302's and loss of session.
Any guidance on how to proceed with this would be much appreciated


Z
_______________________________________________
dancer-users mailing list
dancer-users@dancer.pm
http://lists.preshweb.co.uk/mailman/listinfo/dancer-users

Reply via email to