Re: [RFC PATCH v7 11/9] [PoC] gitweb/lib - tee, i.e. print and capture during cache entry generation

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jakub Narebski
Date: Tuesday, January 4, 2011 - 6:20 am

Jakub Narebski wrote:
[...]

I was not sure how Perl reacts to ENOSPC (No space left on device), 
which I think it is only error that can be generated in flight as
cache is being generated (or as gitweb output is printed i.e. sent
to browser and captured/tee-ed i.e. saved to cache entry file), so
I have checked this (using loopback to create small filesystem).

The outcomes one worry about are the following:
* Perl dies during printing - this leads to broken page send to
  browser, and no cache entry generated
* Perl prints output without dying at all; the page send to browser
  via tee-in is all right, but cache entry is truncated which results
  in broken page shown to other clients.

But what actually happens is actually different, and quite safe:
* Perl prints output without dying, and dies on closing cache entry
  file with ENOSPC.  This means that client generating data gets correct
  output, and cache entry is not generated.  Other clients with my code
  try their hand at generation and also get correct page, but not save
  it to cache.

This means that no error page about problems with cache is shown, which
is bad.  On the other hand, at least for smaller sites, gitweb keeps 
working as if without cache for newer entries.
  
Note that observed behaviour might depend on operating system / filesystem
parameters, such as buffer sizes.


[...]


Errr... now after rereading your email I see that caching error pages
has one problem: errors that come from the caching engine or capturing
engine - those errors you cannot cache.  Sorry, my mistake.


Sent as
  [RFC PATCH v7 2.5/9] gitweb: Make die_error just die, and use send_error
    to create error pages
  Message-ID: <201101040135.08638.jnareb@gmail.com>
  http://permalink.gmane.org/gmane.comp.version-control.git/164466

-- 
Jakub Narebski
Poland
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC PATCH v7 4/9] gitweb: Prepare for splitting gitweb, Jakub Narebski, (Wed Dec 22, 4:56 pm)
[RFC PATCH v7 9/9] gitweb: Add optional output caching, Jakub Narebski, (Wed Dec 22, 4:58 pm)
Re: [RFC PATCH v7 4/9] gitweb: Prepare for splitting gitweb, Jonathan Nieder, (Fri Dec 24, 2:29 am)
[RFC/PATCH] diff: funcname and word patterns for perl, Jonathan Nieder, (Sun Dec 26, 2:07 am)
Re: [RFC/PATCH] diff: funcname and word patterns for perl, Jonathan Nieder, (Sun Dec 26, 3:54 am)
Re: [RFC/PATCH] diff: funcname and word patterns for perl, Jonathan Nieder, (Sun Dec 26, 4:22 am)
Re: [RFC/PATCH] diff: funcname and word patterns for perl, Jakub Narebski, (Sun Dec 26, 4:14 pm)
Re: [RFC/PATCH] diff: funcname and word patterns for perl, Junio C Hamano, (Mon Dec 27, 10:18 am)
Re: [RFC/PATCH] diff: funcname and word patterns for perl, Jakub Narebski, (Mon Dec 27, 3:44 pm)
Re: [RFC PATCH v7 11/9] [PoC] gitweb/lib - tee, i.e. print ..., Jakub Narebski, (Tue Jan 4, 6:20 am)