Project

General

Profile

Actions

Bug #838

closed

librados should not write to stderr or ceph logs, touch pid files, silently read config files

Added by Anonymous about 13 years ago. Updated about 13 years ago.

Status:
Duplicate
Priority:
Normal
Assignee:
-
Category:
librados
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Regression:
Severity:
Reviewed:
Affected Versions:
ceph-qa-suite:
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

Using the Python bindings just as an easy way to init librados, the bug does not reside in the bindings.

proof of stderr:

$ env LD_LIBRARY_PATH=.libs PYTHONPATH=pybind python -c 'import rados; r=rados.Rados()' >/dev/null
2011-02-28 10:10:24.633913 7fe104c15700 ceph version 0.26~rc (commit:040e54608209aaf7ea1379bf694728bc32dd577a)

proof of ceph log writing:

$ strace -e open env LD_LIBRARY_PATH=.libs PYTHONPATH=pybind python -c 'import rados; r=rados.Rados()' 2>&1|grep /out/
open("/home/tv/src/ceph.git/src/out/dreamer.21694", O_WRONLY|O_CREAT|O_APPEND, 0600) = 3

proof of pid file interaction:

$ strace -e open env LD_LIBRARY_PATH=.libs PYTHONPATH=pybind python -c 'import rados; r=rados.Rados()' 2>&1|grep pid
open("out/librados.admin.pid", O_RDONLY) = -1 ENOENT (No such file or directory)

and lastly, and this you might disagree with, I think general-purpose libraries should not read config files by default.

proof of config file reading:

$ strace -e open env LD_LIBRARY_PATH=.libs PYTHONPATH=pybind python -c 'import rados; r=rados.Rados()' 2>&1|grep conf
open("/etc/ceph/ceph.conf", O_RDONLY)   = -1 ENOENT (No such file or directory)
open("~/.ceph/config", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("ceph.conf", O_RDONLY)             = 3
open("/etc/ceph/ceph.conf", O_RDONLY)   = -1 ENOENT (No such file or directory)
open("~/.ceph/config", O_RDONLY)        = -1 ENOENT (No such file or directory)
open("ceph.conf", O_RDONLY)             = 4

I'm extra concerned about reading ceph.conf from the current dir; that means e.g. user tools built on top of librados are brittle.. Imagine cd'ing into a ceph source tree and suddenly a bunch of your tools fail.

Also, it reads the config twice?

Actions #1

Updated by Anonymous about 13 years ago

The log to stderr part was meant to complain about logging a "greeting". Logging on an actual error is more acceptable (even though still a bit messy), but to have a line logged every time is just noise.

Actions #2

Updated by Colin McCabe about 13 years ago

  • Status changed from New to Duplicate

Good observations. These are being addressed in the next release by #840 and #842, which are subtasks of #815

Comments welcome as always, especially on what we think the defaults should be in library code (#842) !

Actions

Also available in: Atom PDF