-
Notifications
You must be signed in to change notification settings - Fork 458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trim a spurious log message for plugins using RPC #186
Trim a spurious log message for plugins using RPC #186
Conversation
Thanks @tbehling! I think it may still be useful to log the closed case as debug, so that there's an indication why the server exited if the caller wasn't expecting it. The (also make sure to run |
Hi @jbardin, thank you so much for giving this a review, and for our subsequent conversation. Based on your comments, I've updated this PR to retain the log message, but print it with I see the I don't love the complexity, but the alternative is to compare the Go error text, which has been done by a lot of Go projects in the past, but is fragile, and the text has changed before. |
54ac37d
to
b21e7d8
Compare
Hi again @jbardin, per our discussion, I have dropped the compatibility with old versions of Go, which simplifies this PR a lot. If I now build the
The difference from the original is that second I also bumped This PR doesn't have Go CI tests, but locally, |
For reference there is some discussion about Go's |
Reference: https://pkg.go.dev/golang.org/x/[email protected]/context Reference: #186 Previously, the module was only using `golang.org/x/net/context` import. That package was deprecated with Go 1.7 when its functionality migrated into the standard library `context` package. This Go module already announces Go 1.17 minimum since version 1.4.4 and the `context` types are not exposed as part of any exported API.
Reference: https://pkg.go.dev/golang.org/x/[email protected]/context Reference: #186 Previously, the module was only using `golang.org/x/net/context` import. That package was deprecated with Go 1.7 when its functionality migrated into the standard library `context` package. This Go module already announces Go 1.17 minimum since version 1.4.4 and the `context` types are not exposed as part of any exported API.
This PR trims a spurious log message for plugins using RPC.
When a plugin is shutting down, the plugin host's log will often report an error about
accept unix
/use of closed network connection
. Essentially, anaccept
call is getting invoked on a socket that is already closed. This PR simply updates the RPC server'saccept
loop to avoid logging that error.This PR makes an assumption that there are no legitimate debugging situations where this error indication is helpful.
As reported in #72, when using the "basic" example in this repo, the output is the following:
With this patch, the line about
use of closed network connection
is absent.Fixes #72
Fixes cloud-native-go/examples#2