[dancer-users] potential memory leak?
Zahir Lalani
ZahirLalani at oliver.agency
Thu Mar 21 13:30:32 GMT 2019
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20190321/fb9b5588/attachment.html>
More information about the dancer-users
mailing list