'On certain sites when a mongo cursor error occurs a plain page is returned with the error, site installation details and most critically a 200 status code. With the 200 status code the page is cached in Varnish and Akamai as a "good" page. The frequency of this should be lowered by implementing Memcache but the errors still need to return error codes to prevent being cached.'

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

cyberswat’s picture

Status: Active » Needs review
FileSize
750 bytes
fgm’s picture

Issue summary: View changes
Status: Needs review » Needs work
FileSize
738 bytes

Rerolled on today's HEAD. Also, I think a 503 (Service unavailable) is more accurate than an 502, which is mean for HTTP proxies and gateways, not origin servers.

I'm not a fan of killing the whole page for a mongodb connection failure to a cache, though : the page might be able to continue and finish being served normally from uncached content if cache is the only service routed to this specific MongoDB instance. Or at least finish the page release as in drupal_page_footer().

Any feedback ?

fgm’s picture

Status: Needs work » Needs review
FileSize
1.8 KB

Here is a new version on today's HEAD which does return a 503 on exception, but does it at the end of the page cycle, not exiting in the middle of the page cycle. Any opinions ?

fgm’s picture

FileSize
1.78 KB

Rerolled on today's updated 7.x-1.x. Current tests pass, but I feel such a change would warrant a test case.

fgm’s picture

Status: Needs review » Needs work

The current version fails to catch errors during bin construction, such as those occurring is the server is not available.

  • fgm committed 0ca6204 on 7.x-1.x
    Issue #1702544 by cyberswat,fgm: fixed Mongo errors not returning error...
fgm’s picture

Status: Needs work » Fixed

Fix added and committed to today's 7.x-1.x HEAD, thanks.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.