unilog icon indicating copy to clipboard operation
unilog copied to clipboard

unilog should complain more forcefully if initial open of the output target fails

Open jmillikin-stripe opened this issue 8 years ago • 2 comments

func (u *Unilog) reopen() error { /* open(u.target) or return err */ }

func (u *Unilog) Main() {
	// [...]
	u.target = flag.Arg(0)
	u.reopen() // error is discarded

This makes it easy to accidentally misconfigure a system, especially if unilog's stderr is being sent to a different location than its output target.

Ideally, unilog should exit(1) if that first reopen fails -- that would make the problem easy to discover. For backwards compatibility, that exit may need to be put behind a flag so existing users can roll it out incrementally.

jmillikin-stripe avatar Jun 15 '17 16:06 jmillikin-stripe

Good point!

To be clear, this wouldn't catch the issue we just found (the austerity file not being mounted), but that's by design - the austerity file shouldn't be a hard dependency for the system.

ChimeraCoder avatar Jun 15 '17 16:06 ChimeraCoder

This issue is about a different problem -- say you ran Unilog writing to /remote-replicated-logs/some-job/output.log, and /remote-replicated-logs/some-job/ doesn't exist. If you didn't have remote visibility into the unilog stderr, then it would be difficult to notice that the logs are getting thrown away.

jmillikin-stripe avatar Jun 15 '17 17:06 jmillikin-stripe