pivotal / skenario

A simulator toolkit for Knative
Apache License 2.0
29 stars 10 forks source link

Sync STDERR and STDOUT. #103

Closed josephburnett closed 4 years ago

josephburnett commented 4 years ago

Hashicorp plugins redirect os.Stderr and os.Stdout to a pipe from which the plugin client (the simulator) can read. This allows plugins to log as normal and the client can discard or display the logs for debugging. However go-plugin did not implement STDERR and STDOUT syncing for gRPC plugins until https://github.com/hashicorp/go-plugin/pull/135.

Plugins such as the HPA controller log quite a bit and the pipe fills because no one is reading from it. Once the pipe is full, the simulation will deadlock with the sim waiting for the plugin to scale, and the plugin waiting for the sim to read from STDERR.

This change upgrades all modules to go-plugin to v1.3.0 to enable draining STDERR. Currently the logs are discarded. But they can be output by passing os.Stderr to NewClient as the SyncStderr parameter.