Hi Chris,

On 5/10/11 8:52 PM, Chris McDonough wrote:
I've taken a look at the patch provided via
https://github.com/Supervisor/supervisor/pull/10 .  It ensures that, for
rotated file logs at least, that if two processes log to the same
filename, that the same stream is used for both processes.

The issue that has been coming up when Whit sees file logs rotate (when
a file size is rolled over, the handler for process A does rotation, but
then process B's handler also does it too, which leads to weirdness).

My question is:  do we want to advertise support for two separate
processes logging to the same file name in this way?

If it's not going to cause other problems inside Supervisor, I don't see a reason we should disallow it.

If not, I should probably work up a patch that logs a warning when the
system detects that it's logging two process' files to the same filename
and provide an alternate mechanism for doing the same thing (like
syslog, or something else).

I do think we should eventually implement syslog support regardless. This has come up a few times on the mailing list.

If so, the patch looks reasonable, but maybe a bit purpose-focused.
I suspect we should instead apply it to the lower level FileHandler
instead of to RotatingFileHandler.

I looked at an earlier version of this patch. It seemed that the tests provided passed before the rest of the patch was applied. If I'm wrong or that's no longer the case, please feel free to commit it or a variation of it.

One other issue with the patch is that keys in the open_streams dict are never removed. The keys are the log filenames. If the configuration is reloaded and the processes or log files are changed, it will "leak" keys in this dict. I don't think this will be a problem for most Supervisor users because configuration changes are infrequent. I have some customers using the twiddler plugin in a special application where supervisord has a very long uptime and the process configuration changes as often as every minute. I believe the potential memory growth could be a problem for them.

Thanks,
Mike

--
Mike Naberezny
Maintainable Software
http://maintainable.com
_______________________________________________
Supervisor-users mailing list
[email protected]
http://lists.supervisord.org/mailman/listinfo/supervisor-users

Reply via email to