Re: [PATCH] BUG/MINOR: log: GMT offset not updated when entering/leaving DST

2016-03-14 Thread Benoît GARNIER
Hi Willy, Le 14/03/2016 20:40, Willy Tarreau a écrit : >> Anyway, older version of strftime() also used to call tzset() (or an >> internal variant), that's why I'm very nervous about my previous patch >> used inside a chroot(). > Got it, thanks for the explanation. So now all what matters is to

Re: [PATCH] BUG/MINOR: log: GMT offset not updated when entering/leaving DST

2016-03-14 Thread Willy Tarreau
Hi Benoit, On Mon, Mar 14, 2016 at 07:49:14PM +0100, Benoît GARNIER wrote: > Le 14/03/2016 09:53, Willy Tarreau a écrit : > > I find this strange, it would mean that glibc would perform file system > > accesses for each call to localtime() which doesn't match my observations > > (would be

Re: [PATCH] BUG/MINOR: log: GMT offset not updated when entering/leaving DST

2016-03-14 Thread Benoît GARNIER
Hello Willy, Le 14/03/2016 09:53, Willy Tarreau a écrit : > I find this strange, it would mean that glibc would perform file system > accesses for each call to localtime() which doesn't match my observations > (would be terribly slow for logging). Yes, localtime() can do an access to

Re: [PATCH] BUG/MINOR: log: GMT offset not updated when entering/leaving DST

2016-03-14 Thread Willy Tarreau
On Mon, Mar 14, 2016 at 09:19:27AM +0100, Benoît GARNIER wrote: > >> In this case the only solution is to copy /etc/localtime to > >> /etc/localtime. > > Well, in the worst case it means we'll fall back to the previous behaviour > > (I mean before your patch) if this happens, so that's not the end

Re: [PATCH] BUG/MINOR: log: GMT offset not updated when entering/leaving DST

2016-03-14 Thread Benoît GARNIER
Hello Willy, Le 14/03/2016 08:45, Willy Tarreau a écrit : > Hi Benoit, > > On Mon, Mar 14, 2016 at 08:32:35AM +0100, Benoît GARNIER wrote: >> Hello Willy, >> >> Le 13/03/2016 23:49, Willy Tarreau a écrit : >>> Hi Benoit, >>> >>> On Sat, Mar 12, 2016 at 09:45:25AM +0100, Benoît GARNIER wrote:

Re: [PATCH] BUG/MINOR: log: GMT offset not updated when entering/leaving DST

2016-03-14 Thread Willy Tarreau
Hi Benoit, On Mon, Mar 14, 2016 at 08:32:35AM +0100, Benoît GARNIER wrote: > Hello Willy, > > Le 13/03/2016 23:49, Willy Tarreau a écrit : > > Hi Benoit, > > > > On Sat, Mar 12, 2016 at 09:45:25AM +0100, Benoît GARNIER wrote: > >> You just need to call tzset() once before chrooting to initialize

Re: [PATCH] BUG/MINOR: log: GMT offset not updated when entering/leaving DST

2016-03-14 Thread Benoît GARNIER
Hello Willy, Le 13/03/2016 23:49, Willy Tarreau a écrit : > Hi Benoit, > > On Sat, Mar 12, 2016 at 09:45:25AM +0100, Benoît GARNIER wrote: >> You just need to call tzset() once before chrooting to initialize the >> timezone subsystem. > Finally I did it directly in your patch, it was not worth

Re: [PATCH] BUG/MINOR: log: GMT offset not updated when entering/leaving DST

2016-03-13 Thread Willy Tarreau
Hi Benoit, On Sat, Mar 12, 2016 at 09:45:25AM +0100, Benoît GARNIER wrote: > You just need to call tzset() once before chrooting to initialize the > timezone subsystem. Finally I did it directly in your patch, it was not worth delaying a release for such a small change. Thanks, Willy

Re: [PATCH] BUG/MINOR: log: GMT offset not updated when entering/leaving DST

2016-03-12 Thread Aleksandar Lazic
Am 12-03-2016 10:50, schrieb Willy Tarreau: Hi Benoit, On Sat, Mar 12, 2016 at 09:45:25AM +0100, Beno?t GARNIER wrote: > On Sat, Mar 12, Willy Tarreau wrote: [snipp] > An extra benefit of proceeding like this is that when we move to > multi-threading, we won't have to lock for something

Re: [PATCH] BUG/MINOR: log: GMT offset not updated when entering/leaving DST

2016-03-12 Thread Willy Tarreau
Hi Benoit, On Sat, Mar 12, 2016 at 09:45:25AM +0100, Beno?t GARNIER wrote: > > Since the cache is local to the function and initialized on the fly, no > > call is performed anymore on startup, it will fail on some chrooted > > systems because when the first log is emitted, you don't have access >

Re: [PATCH] BUG/MINOR: log: GMT offset not updated when entering/leaving DST

2016-03-12 Thread Benoît GARNIER
Hello Willy, Le 12/03/2016 07:54, Willy Tarreau a écrit : >> +/* Return the GMT offset for a specific local time. >> + * The string returned has the same format as returned by strftime(... >> "%z", tm). >> + * Offsets are kept in an internal cache for better performances. >> + */ >> +const char

Re: [PATCH] BUG/MINOR: log: GMT offset not updated when entering/leaving DST

2016-03-11 Thread Willy Tarreau
Hi Benoit, On Sat, Mar 12, 2016 at 12:12:19AM +0100, Benoît GARNIER wrote: > It looked like they were emitted more than 1 hour apart, unlike with the fix: > <14>1 2016-03-27T01:59:58+01:00 bunch-VirtualBox haproxy 3381 - - Connect > ... > <14>1 2016-03-27T03:00:03+02:00 bunch-VirtualBox