[rabbitmq-discuss] Newer version of the erlang emulator and RabbitMQ
Ben Hood
0x6e6562 at gmail.com
Thu Sep 11 17:56:58 BST 2008
Peter,
On Thu, Sep 11, 2008 at 5:34 PM, Peter Kieltyka
<peter.kieltyka at gmail.com> wrote:
> Gotcha. So presently its in the form of a patch but going to be
> included into the next release of Erlang?
God only knows, I'm not on the OTP team, but this is what Björn-Egil
posted to me a while back:
---snip---
It seems to be an error in cpu_sup for darwin and locales, it should
probably use LC_ALL=C uptime instead of LANG=C uptime.
This should resolve it (not fully tested though). diff follows:
------------------------------------------------------------
diff -Naur otp_src_R12B-2/lib/os_mon/src/cpu_sup.erl
otp_src_R12B-2_cpu_sup_fix/lib/os_mon/src/cpu_sup.erl
--- otp_src_R12B-2/lib/os_mon/src/cpu_sup.erl 2008-05-09
15:08:52.228457000 +0200
+++ otp_src_R12B-2_cpu_sup_fix/lib/os_mon/src/cpu_sup.erl
2008-05-09 15:08:43.138456000 +0200
@@ -264,7 +264,7 @@
end;
get_uint32_measurement(Request, #internal{os_type = {unix, darwin}}) ->
%% Get the load average using uptime, overriding Locale setting.
- D = os:cmd("LANG=C uptime") -- "\n",
+ D = os:cmd("LANG=C LC_ALL=C uptime") -- "\n",
%% Here is a sample uptime string from Mac OS 10.3.8 (C Locale):
%% "11:17 up 12 days, 20:39, 2 users, load averages: 1.07 0.95 0.66"
%% The safest way to extract the load averages seems to be grab everything
------------------------------------------------------------
I agree, it is sad that output like this is modified by locale
settings which makes it a little difficult to parse. A more robust way
should be implemented then parsing human readables. No such
implementation is on the horizon nor seriously contemplated at the
moment.
---snip---
> The Erlang website shows that Erlang/OTP R12B-4 was released on
> September 3rd, 2008. But that patch is dated for May 19th. Am I
> missing something here?
I don't really know. The only reason why I even asked was because we
use that call in Rabbit and a user reported an issue with OSX and a
German locale, so I began an enquiry. It didn't seem that the issue
had too high a priority with the OTP team, and neither with me,
because the person that reported the bug disappeared and hence I
didn't much point in wasting energy on it (especially seeing as it
works fine for me on OSX).
As for R12B-4, I'm using it, and it seems fine.
Ben
More information about the rabbitmq-discuss
mailing list