Skip to content
Browse files

Make SystemStatsCollector more portable

Fixes a bug that causes VoltDB to not work on systems where the LANG
environment variables is set to a value that causes the 'ps' utility to
use ',' instead of '.' to indicate decimal fractions.

See: http://community.voltdb.com/node/422

A potentially better fix would be to extend ShellTools so the user can
provide custom environment variables to be used when invoking a process.
This would allow to directly set the LANG environment variable to a
consistent value, rather than dealing with the localization issues in
the output.
  • Loading branch information...
1 parent fc3b6f6 commit 3d24a7b50137daa496ded0026253dccab6ce69b7 @felixge committed
Showing with 5 additions and 0 deletions.
  1. +5 −0 src/frontend/org/voltdb/utils/SystemStatsCollector.java
View
5 src/frontend/org/voltdb/utils/SystemStatsCollector.java
@@ -144,6 +144,11 @@ public static PSData getPSData(int pid) {
return null;
results = lines[1];
results = results.trim();
+
+ // For systems where LANG != en_US.UTF-8.
+ // see: http://community.voltdb.com/node/422
+ results = results.replace(",", ".");
+
String[] values = results.split("\\s+");
// tease out all the stats

0 comments on commit 3d24a7b

Please sign in to comment.
Something went wrong with that request. Please try again.