Hi, I have a broken varnish - not purge's fault!

However, when purge gets an error from varnish it ends up adding the errors to the page requests so they get shown to the end user. A particulary fatal example is when saving a panel. The panel save requests is sent as an ajax requests. The panel page is saved, then purge hooks in to expire the old version of the page from varnish cache. Varnish responds with an error. When the small piece of JSON is returned from panels, it ends up with some output from varnish infront of it which can't be read by ctools which just throws an alert on the screen.

I believe the problem is that on error in the purge_issue_requests_curl function, the object buffer is not cleaned and so the output from varnish is included on the page to the user. Is this by design? I'll attach a patch which fixes this in the comments for review and comment.

Ctools alert is attached as a screenshot.

Output from purge requests from my varnish is below ...

Server: Varnish
Content-Type: text/html; charset=utf-8
Content-Length: 533
Accept-Ranges: bytes
Date: Fri, 19 Apr 2013 10:48:01 GMT
X-Varnish: 450465020
Age: 0
Via: 1.1 varnish
Connection: close
X-Cache: MISS

<?xml version="1.0" encoding="utf-8"?>
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  <html>
    <head>
      <title>405 Not allowed.</title>
    </head>
    <body>
    <h1>This server is experiencing technical problems. Please
try again in a few moments. Thanks for your continued patience, and
we're sorry for any inconvenience this may cause.</h1>
    <p>Error 405 Not allowed.</p>
    <p>Not allowed.</p>
      <p>XID: 450465020</p>
    </body>
   </html>

Comments

johnennew’s picture

Status: Active » Needs review
StatusFileSize
new585 bytes

Patch for review attached.

SqyD’s picture

Status: Needs review » Fixed

Thanks for finding and patching this bug ceng. Has been committed to all branches.

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

cleaned up the opening sentence