Re: Use of Status Code 500

ons 2009-09-02 klockan 08:53 +0200 skrev Svensson, Lars:
> At my place we're a bit unsure of the use of Status Code 500. One of our
> apps (a distributed one) returns a SC 500 when there is a communication
> errror with one of the subsystems.

Sounds reasonable to me. 500 is "unspecified server failure".

>  This caused problems when we upgraded
> our Tomcats to use load-balancing, since the mod-jk now thinks the
> Tomcat returning SC 500 isn't responding properly and switches the
> session to the other Tomcat instance.

Also sounds reasonable for a load balancer configured to hide server
errors.

but it should not mark the server permanently down/malfunctioning only
because of an isolated failure..

>  If the user now repeats the same
> action and the communication error is still there -- leading to a 500
> again--, the mod-jk will block both Tomcats and the user cannot login
> again.

Sounds like a mod-jk defect to me.

> So: Is 500 the correct error code to send in this case and -- if not --
> which one should I use?

500 is quite suitable. Or alternatively 503.

Regards
Henrik

Received on Wednesday, 2 September 2009 09:02:56 UTC