badaiaqrandista has asked for the wisdom of the Perl Monks concerning the following question:

Hi fellow monks,

I work on a web based hotel reservation system. My web application sometime lose the content of the cart, which is stored in a session (that wraps around Apache::Session, which use MySQL as the storage). It loses its content when it goes to the checkout page.

Whenever it happens, it sends an email to us and redirects the user to the start page to redo her booking. So we know when it happens, but it definitely will annoy users.

I and the other programmer have been trying to figure out why that happen for months and we have never been able to point the finger on any part of the code. This error happen intermittently and randomly. We could never see any pattern from the emails sent to us. It happens around 10-20 times a day.

I can not reproduce it in the test system, but it sometimes happen there as well, randomly. But I am worried to trace the error on the production system because it is heavily used 24/7.

Do you guys have any suggestion on how to debug this and find the cause?

UPDATE: more description about my environment.

My webapp runs under mod_perl 1.27 with a home grown application framework on a debian sarge box. Our application runs on multiple hostnames, each client gets its own hostname. But, we only have one secure hostname. The checkout page runs under this hostname. However, both secure and unsecure sites executes the same set of code.

Our session class wraps Apache::Session::MySQL (version 1.01 - Apache::Session's version is 1.6) with OO interface suited for the framework. When a user selects a room, it puts the room in the cart (which theoritically will store the session back to the database storage between requests). I suspect the error comes from the failure of Apache::Session to store/retrieve the data to/from database. But that is impossible, because A::S should throw an error instead.

The database server is shared by two internet facing web servers. It runs MySQL 4.1.1 and the session table type is MyISAM.

Anyway, does anyone know good perl consultants around Gold Coast, Australia?

Thanks

--------------
badaiaqrandista
  • Comment on Debugging intermittent web application bug

Replies are listed 'Best First'.
Re: Debugging intermittent web application bug
by PodMaster (Abbot) on Feb 27, 2006 at 06:59 UTC
    ...Do you guys have any suggestion on how to debug this and find the cause?
    Hire a consultant to do a code review?? If you told us more about your enviroment, we might be able to suggest things to examine.

    It loses its content when it goes to the checkout page.

    Whenever it happens, it sends an email to us and redirects the user to the start page to redo her booking. So we know when it happens, but it definitely will annoy users.

    When its sending an email to you, what kind diagnostic information does it include?

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

      When its sending an email to you, what kind diagnostic information does it include?

      It sends the content of the HTTP header, content of the session, and the query string

      Thanks

      --------------
      badaiaqrandista