git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 0/3] Gitweb caching v7

From
Junio C Hamano <gitster@pobox.com>
Date
Oct 31, 2010, 04:24 UTC
Message-ID
<7v1v773s7e.fsf@alter.siamese.dyndns.org>
In-Reply-To
<m3k4l0girs.fsf@localhost.localdomain>
Jakub Narebski <jnareb@gmail.com> writes:
Show 18 quoted lines
>> I am getting this in the gitweb.log:
>> 
>>     [Fri Oct 29 22:21:12 2010] gitweb.perl: Undefined subroutine 
>>     &main::cache_fetch called at .../t/../gitweb/gitweb.perl line 1124.
>> 
>> which seems to cause t9500 to fail.
>
> This is caused by three issues (bugs) in v7 caching code.
>
> First is the reason why t9500 exhibits this bug.  The gitweb caching
> v7 includes file with subroutines related to caching in the following
> way:
>
>   do 'cache.pm';
>
> Note that the relative path is used; for t9500 it is relative from
> somewhere witjin 't/', and not from 'gitweb/', so "do 'cache.pm';"
> doesn't find it.

John, where should cache.pm go in the installed system? Does it typically go next to gitweb.perl?

I think "do 'that-file'" honors path specified by the -I option, so I do not think "do $cache_pm" is necessary. My preference is to run gitweb tests with appropriate -I pointing at the cache.pm in the directory.

Show 6 quoted lines
> ...  It should be
>
>   do $cache_pm;
>   die $@ if $@;
>
> at least.
Catching failure is a good thing to do.
> Perhaps even better would be to simply turn off caching
> support if there is an error in 'cache.pm'
That can come later.

Jakub, can we have an absolute minimum fix-up, so that we can give this wider exposure? I think there are only four issues:

 (1) exclude Ajax-y stuff from caching;
 (2) install cache.pm the same way gitweb.perl is installed via
     the Makefile;
 (3) running tests with appropriate -I so that cache.pm is found; and
 (4) die if 'cache.pm' cannot be "done").

I think the change in gitweb-cache v7 is small and safe enough that we should fast-track it to give usability to the real world sites. It may be a low-risk "obviously correct" approach that is quick-and-dirty, but that is exactly why this should be fast-tracked. It does not touch the logic or formatting in any way, just bypasses the page generation altogether when it can clearly do so when it can tell the output cannot possibly be incorrect (albeit sometimes it might be stale if in certain cases, e.g. it is relative to HEAD).

I know you and others were aiming to split things up, but I think the amount of the effort that is needed for that line of work on top of the current codebase is not much different from what is needed on top of gitweb-cache v7.

Previous: Jakub NarebskiNext: Jakub Narebski
Message 12 of 43 in “Gitweb caching v7”
  1. 0/3 Gitweb caching v7John 'Warthog9' Hawley, Oct 28, 2010
  2. 1/3 gitweb: Add option to force version matchJohn 'Warthog9' Hawley, Oct 28, 2010
  3. Jakub NarebskiOct 28, 2010
  4. Junio C HamanoOct 28, 2010
  5. 2/3 gitweb: add output buffering and associated functionsJohn 'Warthog9' Hawley, Oct 28, 2010
  6. Jakub NarebskiOct 28, 2010
  7. 3/3 gitweb: File based caching layer (from git.kernel.org)John 'Warthog9' Hawley, Oct 28, 2010
  8. Jakub NarebskiOct 28, 2010
  9. Junio C HamanoOct 28, 2010
  10. Junio C HamanoOct 29, 2010
  11. Jakub NarebskiOct 30, 2010
  12. Junio C HamanoOct 31, 2010
  13. Jakub NarebskiOct 31, 2010
  14. 0/4 Gitweb caching v7.1Jakub Narebski, Nov 1, 2010
  15. 0/4 Gitweb caching v7.2Jakub Narebski, Nov 12, 2010
  16. 1/4 gitweb: Prepare for splitting gitwebJakub Narebski, Nov 12, 2010
  17. Junio C HamanoNov 17, 2010
  18. Jakub NarebskiNov 18, 2010
  19. 1/4 gitweb: Prepare for splitting gitwebJakub Narebski, Dec 2, 2010
  20. Junio C HamanoDec 2, 2010
  21. Jakub NarebskiDec 2, 2010
  22. Junio C HamanoDec 2, 2010
  23. Jakub NarebskiDec 2, 2010
  24. 2/4 gitweb: add output buffering and associated functionsJakub Narebski, Nov 12, 2010
  25. 3/4 gitweb: File based caching layer (from git.kernel.org)Jakub Narebski, Nov 12, 2010
  26. 3/4 gitweb: File based caching layer (from git.kernel.org)Jakub Narebski, Nov 28, 2010
  27. Jakub NarebskiNov 28, 2010
  28. Junio C HamanoNov 29, 2010
  29. Junio C HamanoNov 29, 2010
  30. 3/4 gitweb: File based caching layer (from git.kernel.org)Jakub Narebski, Nov 29, 2010
  31. Junio C HamanoNov 30, 2010
  32. Jakub NarebskiNov 30, 2010
  33. demerphqNov 29, 2010
  34. demerphqNov 29, 2010
  35. Jakub NarebskiNov 29, 2010
  36. 4/4 gitweb: Minimal testing of gitweb cachingJakub Narebski, Nov 13, 2010
  37. Junio C HamanoNov 17, 2010
  38. Jakub NarebskiNov 17, 2010
  39. 1/4 gitweb: Prepare for splitting gitwebJakub Narebski, Nov 1, 2010
  40. 1/4 gitweb: Prepare for splitting gitwebJakub Narebski, Nov 1, 2010
  41. 2/4 gitweb: add output buffering and associated functionsJakub Narebski, Nov 1, 2010
  42. 3/4 gitweb: File based caching layer (from git.kernel.org)Jakub Narebski, Nov 1, 2010
  43. 4/4 gitweb: Minimal testing of gitweb cachingJakub Narebski, Nov 1, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.