Attention for mod_cron users

13 views
Skip to first unread message

Konstantin Nikiforov

unread,
Nov 23, 2011, 6:32:59 AM11/23/11
to zotoni...@googlegroups.com
I observed a problem on one of boxes: erlang timer:sleep() goes hurry.
In short: some tasks are executed twice or more. To check, if problem
exist in your box, run following test in zotonic console:

io:format("~p~n",[erlang:localtime()]),
timer:sleep(600 * 1000),
erlang:localtime().

And wait 10 minutes. The good servers prints result like this:

> {{2011,11,23},{15,8,31}}
> {{2011,11,23},{15,18,31}}

And one bad box printed this:

> {{2011,11,23},{15,8,31}}
> {{2011,11,23},{15,18,26}}

I don't know, why timer:sleep(10minutes) is a
problem for some enviroments. I think, this issue depends on
linux-kernel version/configuration or some sort of erts bug on fresh
kernels.
Both machines has Erlang R14B04 (erts-5.8.5), but different kernels
(2.6.32 ok / 3.0 bad).

signature.asc

Jeff Bell

unread,
Nov 23, 2011, 8:47:49 AM11/23/11
to zotoni...@googlegroups.com
Archlinux seems fine

[jbell@arch ~]$ uname -svrmpo
Linux 3.0-ARCH #1 SMP PREEMPT Wed Aug 17 20:24:07 UTC 2011 i686 Intel(R) Core(TM)2 Duo CPU T6600 @ 2.20GHz GNU/Linux

...

6> io:format("~p~n", [erlang:localtime()]), timer:sleep(600*1000), erlang:localtime().
{{2011,11,23},{8,33,47}}
{{2011,11,23},{8,43,47}}

Konstantin Nikiforov

unread,
Nov 23, 2011, 9:29:50 AM11/23/11
to zotoni...@googlegroups.com
Thanks for information.

Your data made me to remember that I had to built erlang
from source near month ago (because R14B04 was not located in
archlinux repos, but was really needed ASAP).

Now, I've reinstalled erlang-R14B04 from official repos, and problem
gone away.

And looks like this is CFLAGS problem:
-march=native -O3 -pipe -ftree-vectorize -msse -msse2 -msse3

Folks, do not build erlang from source with -O3 :)


В Wed, 23 Nov 2011 08:47:49 -0500
Jeff Bell <jeff....@gmail.com> пишет:

signature.asc
Reply all
Reply to author
Forward
0 new messages