Re: [exim] caching of file contents in expansion testing mod…

Inizio della pagina
Delete this message
Reply to this message
Autore: Philip Hazel
Data:  
To: Matthias Waffenschmidt
CC: exim-users
Oggetto: Re: [exim] caching of file contents in expansion testing mode
On Wed, 23 Nov 2005, Matthias Waffenschmidt wrote:

> when debugging an expansion problem via -be I discovered the following
> problem (running version 4.52 on FreeBSD):
>
> If you're using a file lookup like
>
> ${if eq {${lookup{whatever}nwildlsearch{/some/file}}}{test}{yes}{no}}
>
> the file contents are cached and will not be reread if /some/file has
> been changed (-d always says 'cached open').
>
> Is this a feature or a bug? If it is a feature (I don't guess so) it
> should be documented in the docs.


Exim caches the results of lookups *within the same process*. Since Exim
processes normally run for a short time, and do just one job (e.g.
receive a message, deliver a message), this is not a problem. A change
to the file will be picked up by the next Exim process that reads it.

If you start an Exim -be process and do a lookup, then change the file,
then re-issue the same lookup within the same Exim process, then yes,
you'll get the same answer.

Exim could discard its caches after each line when testing with -be, but
then you couldn't use -be for testing the caching! Exim's test suite
currently uses this test.


-- 
Philip Hazel            University of Cambridge Computing Service,
ph10@???      Cambridge, England. Phone: +44 1223 334714.
Get the Exim 4 book:    http://www.uit.co.uk/exim-book