hashicorp / hashicorp/go-plugin

yamux writes logs directly to stderr

Open
#169 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
6.1k
Forks
511
Avg merge
22h 47m
Merged PRs (30d)
4

Description

The RPCClient uses the default yamux client configuration settings.

https://github.com/hashicorp/go-plugin/blob/0c19a1387af146eaa3335dad0a021741344ac3e9/rpc_client.go#L63

This means that even though we passed a logger to the plugin client, the yamux logs ignore it and are printed directly to stderr. It is causing us a lot of confusion when reading the plugin logs, since any problems with yamux aren't showing up where we expect to find them.

As an aside, if anyone has information on why yamux sometimes logs stuff like the following, I'd appreciate any pointers. I can't tell if this is expected or it indicates that I'm using the plugin framework incorrectly.

```
2021/03/16 23:13:31 [ERR] yamux: Failed to write header: write unix @->/tmp/plugin383370083: write: broken pipe
2021/03/16 23:15:41 [ERR] yamux: Failed to write header: write unix @->/tmp/plugin806433500: use of closed network connection
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.