bitpiston / oyster

A Perl web application framework.
Other
3 stars 1 forks source link

404s throw a internal error on 2nd request and onwards #54

Closed einkoro closed 11 years ago

einkoro commented 11 years ago

Originally downstream in Chowder thought to be a content module bug but its part of lib/oyster.pm and/or lib/url.pm:

Looks like the requested URL is cached after the first attempt and its throwing a internal error instead of the usual 404. server.pl doesn't replicate this as its always a new fcgi instance so it has to be reproduced using lighttpd.

Executing Function:
:: ()
Perl Error:
Undefined subroutine &main::main:: called at /usr/home/5381/chowder/shared/lib//oyster.pm line 529.
Trace:
File                          Line Subroutine
...r/shared/lib/exceptions.pm 93   (eval) oyster::__ANON__
...r/shared/lib/exceptions.pm 186  (eval) exceptions::throw
...owder/shared/lib/oyster.pm 530  exceptions::try
...r/shared/lib/exceptions.pm 178  (eval) oyster::__ANON__
...owder/shared/lib/oyster.pm 558  exceptions::try
...chowder/shared/oyster.fcgi 33   (eval) oyster::request_handler

Narrowed it down to line 482–512 in oyster.pm: Commenting out the cached URL check resolves the issue so its most likely url.pm caching 404s improperly or an issue in oyster.pm checking the cache.

einkoro commented 11 years ago

No longer caching anything that throws a 404 – currently checks the length of the requested url's module name.