Skip to content

grpcutil,log: avoid log spam related to TCP probes#55279

Merged
craig[bot] merged 3 commits intocockroachdb:masterfrom
knz:20201007-rpc-log-spam
Oct 7, 2020
Merged

grpcutil,log: avoid log spam related to TCP probes#55279
craig[bot] merged 3 commits intocockroachdb:masterfrom
knz:20201007-rpc-log-spam

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Oct 7, 2020

Fixes #32102

See individual commits for details.

@knz knz requested review from irfansharif and tbg October 7, 2020 10:44
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

knz and others added 3 commits October 7, 2020 13:32
Prior to this patch, a monitoring probe that would just open and close
the TCP port would cause log spam like the following:

```
grpc: Server.Serve failed to complete security handshake from "127.0.0.1:27972": EOF
```

This patch removes it.

(This was tested by using netcat: `nc 127.0.0.1 26257` and then Ctrl+C
to immediately close the connection.)

The patch also cleans up the code around the filtering of grpc log messages.

Release note: None

Co-authored-by: Aaron Zinger <histocrat+github@gmail.com>
Prior to this patch, log messages from the http package would look
like this:

```
E201007 11:15:33.200128 878 httpLoggerserver.go:3088  http: ...
```

Notice how "httpLoggerserver.go" does not correspond to any valid
file.

With this patch:

```
E201007 11:15:33.200128 878 (gostd) net/http/server.go:3088  http: ...
```

Release note: None
Prior to this patch, a monitoring probe that would just open and close
the HTTP port would cause log spam like the following:

```
E201007 11:21:57.101735 882 (gostd) net/http/server.go:3088  http: TLS handshake error from 127.0.0.1:24059: EOF
```

This patch removes it.

(This was tested by using netcat: `nc 127.0.0.1 8080` and then Ctrl+C
to immediately close the connection.)

Release note: None
@knz knz force-pushed the 20201007-rpc-log-spam branch from 5ffe1ea to 0f0ad1d Compare October 7, 2020 11:32
@knz knz changed the title grpcutil: avoid log spam related to TCP probes grpcutil,log: avoid log spam related to TCP probes Oct 7, 2020
@knz
Copy link
Copy Markdown
Contributor Author

knz commented Oct 7, 2020

cc @HonoreDB for the 2nd and 3rd commit

Copy link
Copy Markdown
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 3 files at r1, 2 of 2 files at r2, 1 of 1 files at r3.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @irfansharif and @knz)


pkg/util/log/log_bridge.go, line 29 at r2 (raw file):

// of the file that triggered the logging.
func NewStdLogger(severity Severity, prefix string) *stdLog.Logger {
	if prefix != "" && !strings.HasSuffix(prefix, "/") {

Do we "want" filepath.Separator here or is it / even on windows?

Copy link
Copy Markdown
Contributor Author

@knz knz left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @irfansharif and @tbg)


pkg/util/log/log_bridge.go, line 29 at r2 (raw file):

Previously, tbg (Tobias Grieger) wrote…

Do we "want" filepath.Separator here or is it / even on windows?

Yes in logging windows uses / too.

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Oct 7, 2020

TFYR

bors r=tbg

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Oct 7, 2020

Build succeeded:

@craig craig bot merged commit 5965426 into cockroachdb:master Oct 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

server: TLS handshake log spam from health checks

3 participants