Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syslogging must be exclusive to process #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

carsonreinke
Copy link
Contributor

No description provided.

Set priority on syslog when logging based on level
@colbygk
Copy link
Owner

colbygk commented Sep 4, 2014

Hello, thank you for the contribution. Could you explain further why you believe that syslog is supposed to be process exclusive? According to POSIX, the syslog routines are supposed to be thread-safe on any system claiming POSIX compatibility. See: http://pubs.opengroup.org/onlinepubs/000095399/functions/xsh_chap02_09.html#tag_02_09_01

@carsonreinke
Copy link
Contributor Author

Probably because multiple threads try to open the syslog which produces an error that it as already been opened. Let me double check and test, but probably openlog means it is thread safe, but not necessarily meaning it won't produce an error if called twice.

Added concurrency test for Syslog outputter
@carsonreinke
Copy link
Contributor Author

Added test, actually forgot something so glad I added it ;)

Tested on 2.1.2p95, without a get an error RuntimeError: syslog already open

@colbygk
Copy link
Owner

colbygk commented Sep 4, 2014

I'd like to investigate this further. Based on my reading of: http://www.gnu.org/software/libc/manual/html_node/syslog_003b-vsyslog.html#syslog_003b-vsyslog I'm concerned that this could introduce some other unexpected and unwanted behavior.

@carsonreinke
Copy link
Contributor Author

Not sure, the basic problem is something like this:

Syslog.open{Thread.new{ Syslog.open{} }.join}

@carsonreinke
Copy link
Contributor Author

See this also crohr/syslogger#33

I started using my own logger that uses Syslogger gem instead of just Syslog.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants