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

Upgrade gRPC JVM libs #2276

Merged
merged 5 commits into from
Jul 26, 2019
Merged

Upgrade gRPC JVM libs #2276

merged 5 commits into from
Jul 26, 2019

Conversation

majcherm-da
Copy link
Contributor

@majcherm-da majcherm-da commented Jul 24, 2019

The problem with upgrading JVM's gRPC lib further than 1.19.0 was caused by setting up a stdout/stderr pipe in HS bindings tests, which were not drained causing a backpressure effect on tests on Windows. Sandbox thread was blocked on: https://github.com/grpc/grpc-java/blob/v1.21.0/netty/src/main/java/io/grpc/netty/NettyServerBuilder.java#L512 which is a logger call, logging to stdout. The log line has been added in 1.21.0 of gRPC :)

I modified Sandbox.hs to create sandbox using --port-file option and used standard stdout/stderr proxying to tests' stdout/stderr.

Pull Request Checklist

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

Sorry, something went wrong.

Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

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

Great work, thank you! Only one concern about the test being very noisy now but I’ve not verified this so maybe I’m just missing something.

(_,hOutOpt,_,proh) <-
createProcess processRecord {
std_out = CreatePipe,
std_err = CreatePipe, -- Question: ought the pipe to be drained?
Copy link
Contributor

Choose a reason for hiding this comment

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

Hah 🙂

Copy link
Contributor

Choose a reason for hiding this comment

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

Now we know the answer :)

std_out = CreatePipe,
std_err = CreatePipe, -- Question: ought the pipe to be drained?
create_group = True -- To avoid sending INT to ourself
create_group = True -- To avoid sending INT to ourself
Copy link
Contributor

Choose a reason for hiding this comment

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

I’m not sure I understand this. What exactly is the issue that you are trying to prevent here?

(_,hOutOpt,_,proh) <-
createProcess processRecord {
std_out = CreatePipe,
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean that we are now spamming stdout and stderr during tests? From a quick experiment it looks like sandbox is still very noisy even if you pass --port-file. Maybe just redirect stdout to /dev/null? (stderr seems to be clean by default afaict). typed-process has a cross-platform version of /dev/null that we could either steal or we could just switch to typed-process which generally seems like a saner API (we’ve already switched in other places due to issues with process).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, these are captured by Bazel and put into test.log, which I thought was better to keep, but on the other hand these are mixed with test results - I can redirect them to /dev/null

Copy link
Contributor

Choose a reason for hiding this comment

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

I often run tests via bazel run to be able to pass arguments and see the output as it goes so I would prefer if they are not too noisy.

startSandbox :: SandboxSpec -> IO Sandbox
startSandbox spec = withTempFile $ \portFile -> do
(proh,_hOpt) <- startSandboxProcess spec portFile
portNum <- readPortFile maxRetries portFile
Copy link
Contributor

Choose a reason for hiding this comment

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

Much nicer! 👍

Copy link
Contributor

@nickchapman-da nickchapman-da left a comment

Choose a reason for hiding this comment

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

Nice!

@majcherm-da majcherm-da merged commit 37a9215 into master Jul 26, 2019
@majcherm-da majcherm-da deleted the upgrade_grpc_jvm branch July 26, 2019 12:45
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.

None yet

3 participants