Skip to content

Disable backlog on container start/restart.#252

Closed
roman-vynar wants to merge 2 commits into
gliderlabs:masterfrom
Quiq:backlog
Closed

Disable backlog on container start/restart.#252
roman-vynar wants to merge 2 commits into
gliderlabs:masterfrom
Quiq:backlog

Conversation

@roman-vynar

Copy link
Copy Markdown

Addresses #187, #234

Sending the backlog does not really make sense on container restart or stop/start. Usually, you have those logs already and do not need duplicate ones.

@ebr

ebr commented Jan 12, 2017

Copy link
Copy Markdown
Contributor

@roman-vynar: it was previously mentioned in #187 and/or #201 that backlogs are needed on start because the container might have output logs before logspout has had a chance to connect. That's why #201 implements this as an env. var flag.
(off topic: your city is the loveliest place in the world :))

@roman-vynar

roman-vynar commented Jan 12, 2017

Copy link
Copy Markdown
Author

@ebr then 2 things:

  • what if there are too much pending logs at that moment, sending them all could very expensive
  • when syslog connection is failed, we do not send logs anyway and obviously skip them

So the flag does not solve the above 2 issues. I would say it is better to have an option to send existing logs somehow else if needed on start.

P.S. offtopic: hah thanks, have you been there? 😆

@ebr

ebr commented Jan 16, 2017

Copy link
Copy Markdown
Contributor

@roman-vynar i agree this PR fixes the issue, though in my opinion it's better to provide a runtime flag, in case one relies on being certain that no log lines are lost from the beginning of the container start (and is prepared to deal with expensive sending & duplicates). But this is up to maintainers to decide, of course.

offtop: i grew up there :)

Comment thread router/pump.go
switch event.Status {
case "start", "restart":
go p.pumpLogs(event, true, inactivityTimeout)
go p.pumpLogs(event, false, inactivityTimeout)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps we should only set this to false on restart and have a true case on start. Thoughts?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just saw your previous conversation. I think I'd like to keep backlog set to true on start for now. That at least then doesn't break the current expectation.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can create an option then, if someone needs to re-send them.

Leaving it on start will not help as you can stop/start and it is all sent again.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An option is fine with me.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@roman-vynar is that something you're able to add here? if not, no worries but wanted to check before I run with this.

@michaelshobbs michaelshobbs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments inline

@davidnortonjr

Copy link
Copy Markdown
Contributor

@michaelshobbs #201 works great in my fork (just because somebody already did the work to make it configurable). My vote would be to merge that one.

@michaelshobbs

Copy link
Copy Markdown
Member

I concur. I'll go with #201 unless @roman-vynar has any objection

@roman-vynar

Copy link
Copy Markdown
Author

@michaelshobbs thanks 👍

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants