You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Alexander Rojas <al...@mesosphere.io> on 2015/05/20 07:31:07 UTC

On Locales

Hey guys, I just got a review pointing out that ‘strftime’ is dependent on the locale used. This not only affects my patch but code already in Mesos: process/time.hpp and encoder.hpp both make use of fields which are locale specific. The question here is, how to deal with it?

Locales tend to be a pain since the functions handling them are not thread safe, so I would suggest setting a global locale for mesos programs (master and slaves) on start up, i.e. setlocale(LC_ALL, "C");

Re: On Locales

Posted by Alexander Rojas <al...@mesosphere.io>.
You’re right, I will mark the issue with a TODO and add a Jira ticket.


> On 20 May 2015, at 18:41, Vetoshkin Nikita <ni...@gmail.com> wrote:
> 
> I think situation with locales is similar one to SIGPIPE issues we had a
> while ago, i.e as long as libprocess and stout are considered being
> libraries we can't force users to set process global flags like SIG_IGN.
> So I guess we should fix (or at least mark as FIXME) all locale related
> cases like we did with SIGPIPE.
> 
> On Wed, May 20, 2015, 10:31 Alexander Rojas <al...@mesosphere.io> wrote:
> 
>> Hey guys, I just got a review pointing out that ‘strftime’ is dependent on
>> the locale used. This not only affects my patch but code already in Mesos:
>> process/time.hpp and encoder.hpp both make use of fields which are locale
>> specific. The question here is, how to deal with it?
>> 
>> Locales tend to be a pain since the functions handling them are not thread
>> safe, so I would suggest setting a global locale for mesos programs (master
>> and slaves) on start up, i.e. setlocale(LC_ALL, "C");


Re: On Locales

Posted by Vetoshkin Nikita <ni...@gmail.com>.
I think situation with locales is similar one to SIGPIPE issues we had a
while ago, i.e as long as libprocess and stout are considered being
libraries we can't force users to set process global flags like SIG_IGN.
So I guess we should fix (or at least mark as FIXME) all locale related
cases like we did with SIGPIPE.

On Wed, May 20, 2015, 10:31 Alexander Rojas <al...@mesosphere.io> wrote:

> Hey guys, I just got a review pointing out that ‘strftime’ is dependent on
> the locale used. This not only affects my patch but code already in Mesos:
> process/time.hpp and encoder.hpp both make use of fields which are locale
> specific. The question here is, how to deal with it?
>
> Locales tend to be a pain since the functions handling them are not thread
> safe, so I would suggest setting a global locale for mesos programs (master
> and slaves) on start up, i.e. setlocale(LC_ALL, "C");