[Varnish] #964: varnish is losing (java) session data

Varnish varnish-bugs at varnish-cache.org
Mon Aug 15 12:01:26 CEST 2011


#964: varnish is losing (java) session data
------------------------+---------------------------------------------------
 Reporter:  pravenjohn  |        Type:  defect  
   Status:  new         |    Priority:  normal  
Milestone:              |   Component:  varnishd
  Version:  3.0.0       |    Severity:  normal  
 Keywords:              |  
------------------------+---------------------------------------------------
Changes (by kristian):

  * priority:  high => normal
  * severity:  critical => normal


Old description:

> I've setup a varnish server (3.0) with an apache-tomcat server on the
> backend...
>
> My default.vcl is
> backend ige_static1 {
>   .host = "XXXXXXX";
>   .port = "80";
>   .connect_timeout = 600s;
>   .first_byte_timeout = 600s;
>   .between_bytes_timeout = 600s;
> }
> backend ige_dynamic {
>   .host = "XXXXXX";
>   .port = "80";
>   .connect_timeout = 600s;
>   .first_byte_timeout = 600s;
>   .between_bytes_timeout = 600s;
> }
> sub vcl_recv
> {
>         if (req.request == "PURGE")
>         {
>                 if (!client.ip ~ purge)
>                 {
>                         error 405 "Not allowed.";
>                 }
>                 ban(req.url == req.url);
>                 error 200 "Purging Done";
>         }
>   if (req.request == "POST") {
>          return(pipe);
>      }
>   if (req.url ~ "^/portal|^/saml")
>   {
>     set req.backend = ige_dynamic;
>     return(pass);
>   }
>   set req.backend = ige_static1;
>   return(lookup);
> }
> sub vcl_fetch
> {
>  if (req.url ~ "\.(png|gif|jpg|swf|css|js|html|txt|pdf)$")
>  {
>    unset beresp.http.set-cookie;
>  }
> }
> sub vcl_deliver
> {
>         if (obj.hits > 0)
>         {
>                 set resp.http.X-Cache = "HIT";
>         }
>         else
>         {
>                 set resp.http.X-Cache = "MISS";
>         }
> }
> sub vcl_hit {
>         if (req.request == "PURGE") {
>                 ban (req.url == req.url);
>                 error 200 "Purged.";
>         }
> }
> sub vcl_miss {
>         if (req.request == "PURGE")
>        {
>                 ban (req.url == req.url);
>                 error 200 "Not in cache";
>         }
> }
> sub vcl_pipe
> {
>         set bereq.http.connection = "close";
> }
>
> But for some reason, I seem to be loosing Java session dat along the way.
> I set some data on the JAVA side, and after 2-3 pages interaction, the
> data disappears... I checked the same againist my backend apache-tomcat
> server and it works fine over there...
>
> Any suggestions you can provide would be great... Unless we can fix this
> issue, we'll probably have to migrate out to some other caching
> solution...
>
> Regards
> Praven John

New description:

 I've setup a varnish server (3.0) with an apache-tomcat server on the
 backend...

 My default.vcl is
 {{{
 backend ige_static1 {
   .host = "XXXXXXX";
   .port = "80";
   .connect_timeout = 600s;
   .first_byte_timeout = 600s;
   .between_bytes_timeout = 600s;
 }
 backend ige_dynamic {
   .host = "XXXXXX";
   .port = "80";
   .connect_timeout = 600s;
   .first_byte_timeout = 600s;
   .between_bytes_timeout = 600s;
 }
 sub vcl_recv
 {
         if (req.request == "PURGE")
         {
                 if (!client.ip ~ purge)
                 {
                         error 405 "Not allowed.";
                 }
                 ban(req.url == req.url);
                 error 200 "Purging Done";
         }
   if (req.request == "POST") {
          return(pipe);
      }
   if (req.url ~ "^/portal|^/saml")
   {
     set req.backend = ige_dynamic;
     return(pass);
   }
   set req.backend = ige_static1;
   return(lookup);
 }
 sub vcl_fetch
 {
  if (req.url ~ "\.(png|gif|jpg|swf|css|js|html|txt|pdf)$")
  {
    unset beresp.http.set-cookie;
  }
 }
 sub vcl_deliver
 {
         if (obj.hits > 0)
         {
                 set resp.http.X-Cache = "HIT";
         }
         else
         {
                 set resp.http.X-Cache = "MISS";
         }
 }
 sub vcl_hit {
         if (req.request == "PURGE") {
                 ban (req.url == req.url);
                 error 200 "Purged.";
         }
 }
 sub vcl_miss {
         if (req.request == "PURGE")
        {
                 ban (req.url == req.url);
                 error 200 "Not in cache";
         }
 }
 sub vcl_pipe
 {
         set bereq.http.connection = "close";
 }
 }}}
 But for some reason, I seem to be loosing Java session dat along the way.
 I set some data on the JAVA side, and after 2-3 pages interaction, the
 data disappears... I checked the same againist my backend apache-tomcat
 server and it works fine over there...

 Any suggestions you can provide would be great... Unless we can fix this
 issue, we'll probably have to migrate out to some other caching
 solution...

 Regards
 Praven John

--

-- 
Ticket URL: <http://www.varnish-cache.org/trac/ticket/964#comment:9>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator




More information about the varnish-bugs mailing list