Skip to content
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

"Plugin output is unparseable" when the JVM outputs warnings #104

Open
raboof opened this issue May 10, 2022 · 0 comments
Open

"Plugin output is unparseable" when the JVM outputs warnings #104

raboof opened this issue May 10, 2022 · 0 comments

Comments

@raboof
Copy link

raboof commented May 10, 2022

Is your feature request related to a problem? Please describe.

It is possible for the JVM to output warnings using their "Unified Logging" framework.

For example, when using Java 17, if there are duplicate 'cpuset controllers' you will see a warning about that:

[0.001s][warning][os,container] Duplicate cpuset controllers detected. Picking /sys/fs/cgroup/cpuset, skipping /host/sys/fs/cgroup/cpuset.
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment (build 17.0.3+7-nixos)
OpenJDK 64-Bit Server VM (build 17.0.3+7-nixos, mixed mode, sharing)

Unfortunately, by default, these warnings are printed to stdout. This means when protoc tries to parse the output of a JVM-based protoc plugin, and the JVM prints such a warning, the output is invalid and you will get a "Plugin output is unparseable" error.

Describe the solution you'd like

I would like the default JVM startup scripts (created by ProtocPluginAssembler) to, by default, invoke the JVM with the extra JVM options: -Xlog:disable -Xlog:all=warning:stderr -Xlog:all=error:sterr. -Xlog:disable should stop it from printing warnings to stdout, and -Xlog:all=warning:stderr should AFAICS cause it to print warnings to stderr. In practice unfortunately my JDK17 doesn't actually print them to stderr, but that seems to be a bug on the JVM side and I'm not sure we should care about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant