Skip to content

Revert default changes#50

Merged
k8s-ci-robot merged 2 commits intokubernetes:masterfrom
mtaufen:revert-default-changes
Mar 6, 2019
Merged

Revert default changes#50
k8s-ci-robot merged 2 commits intokubernetes:masterfrom
mtaufen:revert-default-changes

Conversation

@mtaufen
Copy link
Copy Markdown

@mtaufen mtaufen commented Mar 4, 2019

What this PR does / why we need it:
Reverts recent, potentially breaking changes to flag defaults. These block vendoring the latest version of klog into upstream Kubernetes, because they could break user deployments of core Kubernetes components. If these changes are eventually included, they need to be included in a way that respects the upstream deprecation policy (see below).

This PR reverts three other PRs:

  1. Use info in default stderrThreshold #42, which changes the stderrthreshold default to INFO
    • This could cause significant, unexpected increases in logging verbosity.
  2. Default logtostderr to true #39, which changes the logtostderr default to true
    • This, especially, could break existing logging configurations because when set, it disables logs from being sent to files, even if --log_file is set. EDIT: See below conversation, we decided to keep Default logtostderr to true #39 due to pre-existing overrides in k/k, but still revert the other two.
  3. stderrthreshold is useless if logtostderr is set #31, which conditions tostderr output on stderrthreshold

Adding these changes back in can be revisited and discussed during code slush, but I would like to back them out in order to get the O_APPEND fix into Kubernetes 1.14.

If we decide to include these changes in upstream Kubernetes, we need to follow the official policy of announcing deprecation of old defaults and waiting the appropriate amount of time before changing them: https://kubernetes.io/docs/reference/using-api/deprecation-policy/. In the future, we need to figure out how to more carefully coordinate changes to defaults in this repo with deprecation policies of other Kubernetes projects.

Release note:

Recent commits that changed --stderrthreshold default from ERROR to INFO and conditioned --tostderr output on --stderrthreshold have been reverted.

…-stderr"

This reverts commit 71442cd, reversing
changes made to 5093042.
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Mar 4, 2019
@mtaufen
Copy link
Copy Markdown
Author

mtaufen commented Mar 4, 2019

/kind bug
/priority critical-urgent
/assign @liggitt @dims
/cc @DirectXMan12 @vincepri @shsjshentao @justinsb

@k8s-ci-robot k8s-ci-robot added the kind/bug Categorizes issue or PR as related to a bug. label Mar 4, 2019
@k8s-ci-robot
Copy link
Copy Markdown

@mtaufen: GitHub didn't allow me to request PR reviews from the following users: shsjshentao.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

Details

In response to this:

/kind bug
/assign @liggitt @dims
/cc @DirectXMan12 @vincepri @shsjshentao

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. label Mar 4, 2019
Copy link
Copy Markdown
Member

@neolit123 neolit123 left a comment

Choose a reason for hiding this comment

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

@neolit123
Copy link
Copy Markdown
Member

if we consider klog usage as GA and user facing -> GA: 12 months or 2 releases (whichever is longer)
https://kubernetes.io/docs/reference/using-api/deprecation-policy/#deprecating-a-flag-or-cli

@DirectXMan12
Copy link
Copy Markdown

DirectXMan12 commented Mar 4, 2019

@mtaufen we already default to logtostderr in k/k proper and anything that pulls in k/apiserver (which is a lot of stuff, by accident) in previous versions, and now anything that pulls in k/component-base (https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/component-base/logs/logs.go#L37)

@DirectXMan12
Copy link
Copy Markdown

DirectXMan12 commented Mar 4, 2019

#31 I've seen actively confuse plenty of people before, so it's not clear to me that people were actually expecting it to work as it did before #31 merged (which is not the best reason for breaking compatibility, but it's some justification). Practically, it's not clear to me that #42 actually has any impact on anyone's logging. We explicitly state that info log level 0 is message that everyone should see, and currently logtostderr causes info to go to stderr anyway (unless I'm misunderstanding here).

That being said, I'm not super-against reverting #31 and #42 until we can have a later discussion.

@vincepri
Copy link
Copy Markdown
Member

vincepri commented Mar 5, 2019

The main reason behind the changes proposed in #39 and #41 is to clarify the development experience and the true default for users. The logtostderr flag is hardcoded to true in init or main functions across the codebase, which results in an incorrect default to be printed in help usage sections and the impossibility for end users to overwrite this flag.

Sidenote: #42 was needed because of #31.

@DirectXMan12
Copy link
Copy Markdown

We talked about this on the component-wg meeting. The upshot is that #39 is fine to deep (since it's defaulted across k/k and k/component-base anyway), but #42 could cause you to receive extra INFO-level logs on stderr if you're trying to just use files and don't expect much to be going to stderr (since stderrthreshold comes into effect whether or not logtostderr or alsologtostderr are set:

klog/klog.go

Lines 741 to 748 in ad78c01

if l.toStderr {
if s >= l.stderrThreshold.get() {
os.Stderr.Write(data)
}
} else {
if alsoToStderr || l.alsoToStderr || s >= l.stderrThreshold.get() {
os.Stderr.Write(data)
}

SInce #42 and #31 are tied together, it's probably best to revert them together to avoid behavior changes.

As a broader effort, we should figure out the semantics that we want for a logging library around things like verbosity, etc, and propose that, figuring out specific deprecation paths for the older stuff. Doing this piecemeal is probably going to be harder.

@DirectXMan12
Copy link
Copy Markdown

@mtaufen if you drop the revert of #39, I'm LGTM on this PR.

@vincepri
Copy link
Copy Markdown
Member

vincepri commented Mar 5, 2019

+1 on reverting #31 and #42 but keep #39.

This reverts commit f0c3f94, reversing
changes made to 73cec49.
@mtaufen mtaufen force-pushed the revert-default-changes branch from d247a75 to af1d50a Compare March 6, 2019 01:48
@mtaufen
Copy link
Copy Markdown
Author

mtaufen commented Mar 6, 2019

Thanks everyone!
@DirectXMan12 updated to drop the revert of #39.

@DirectXMan12
Copy link
Copy Markdown

/lgtm

We seem to have some amount of concensus among maintainers here (+1 from me, vincepri) and lack of anyone vociferously complaining.

I'll give it till tomorrow morning, and then give the approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 6, 2019
@k8s-ci-robot
Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: DirectXMan12, mtaufen

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 6, 2019
@k8s-ci-robot k8s-ci-robot merged commit 8e90cee into kubernetes:master Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/critical-urgent Highest priority. Must be actively worked on as someone's top priority right now. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants