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

Is logging within circus multiprocess safe? #1148

Open
varunbpatil opened this issue Sep 25, 2020 · 1 comment
Open

Is logging within circus multiprocess safe? #1148

varunbpatil opened this issue Sep 25, 2020 · 1 comment

Comments

@varunbpatil
Copy link

If I have numprocesses > 1, do the logs from each of those processes get written to StdoutStream or *FileStream in a multiprocess-safe manner ? i.e, do the outputs from each of the processes interfere with each other and become garbled? I don't see any locking in the implementation of the streams.

If it is not multiprocess-safe, how do I go about making it multiprocess-safe? Do I have to implement a new stream like a SocketStream on the lines of this example?

@biozz
Copy link
Contributor

biozz commented Oct 1, 2020

Hi @varunbpatil.

There is no locking mechanisms in circus, several processes will just output when they are ready. This means that you can expect having things like this in your log files (latest entry has earlier timestamp):

2020-10-01T23:30:56.422724 - 41023:13
2020-10-01T23:30:56.422717 - 41028:12

I don't have much experience making multiprocess-safe stuff, so I couldn't advise you on how to implement this. You are always welcome to submit PRs to add this functionality in circus.

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

No branches or pull requests

2 participants