-
Notifications
You must be signed in to change notification settings - Fork 926
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
Intermittent test failure: LazyDynamicEndpointGroupTest.emptyEndpoint() #3381
Comments
Let me close this issue because the exception is a |
Yeah, it shouldn't be a |
Still seeing it: https://github.com/line/armeria/runs/2554163261#step:7:1887 |
ikhoon
added a commit
to ikhoon/armeria
that referenced
this issue
Jun 15, 2021
…izing a context Motivation: `LazyDynamicEndpointGroupTest.emptyEndpoint()` sometimes failed in CI builds. line#3381 It expects to fail the test with `EmptyEndpointException`, however it fails with `ClosedStreamException`. After digging the issue, I find out that there is a race in `whenInitialized`. If the `acquiredEventLoop.execute()` is executed immediately and eailer than returning the method, https://github.com/line/armeria/blob/d4880fe12690d2dafd2c5e7fa9f24c3b24837a00/core/src/main/java/com/linecorp/armeria/client/DefaultClientRequestContext.java#L307-L309 the callbacks of `ctx.whenInitialized()` will be invoked before a `RequestLog` is completed. https://github.com/line/armeria/blob/207c5e038f59802dca769936a50e219a5fe308ea/grpc/src/main/java/com/linecorp/armeria/internal/client/grpc/ArmeriaClientCall.java#L337-L348 As the `req` is closed already, the `req.write()` would be failed with `ClosedStreamException`. Modifications: - Complete `DefaultClientRequestContext.whenIntialized()` after `initContextAndExecuteWithFallback` of `ClientUtil` Result: - You no longer see `ClosedStreamException` when an `EndpointGroup` is empty. - Fixes line#3381
trustin
pushed a commit
that referenced
this issue
Jun 18, 2021
…nitializing a context (#3636) Motivation: `LazyDynamicEndpointGroupTest.emptyEndpoint()` sometimes failed in CI builds. #3381 It expects to fail the test with `EmptyEndpointException`, however, it fails with `ClosedStreamException`. After digging the issue, I find out that there is a race in `whenInitialized`. If the `acquiredEventLoop.execute()` is executed immediately and completed earlier than returning the method, https://github.com/line/armeria/blob/d4880fe12690d2dafd2c5e7fa9f24c3b24837a00/core/src/main/java/com/linecorp/armeria/client/DefaultClientRequestContext.java#L307-L309 the callbacks of `ctx.whenInitialized()` will be invoked before a `RequestLog` is completed. https://github.com/line/armeria/blob/207c5e038f59802dca769936a50e219a5fe308ea/grpc/src/main/java/com/linecorp/armeria/internal/client/grpc/ArmeriaClientCall.java#L337-L348 As the `req` is closed already, the `req.write()` would be failed with `ClosedStreamException`. Modifications: - Complete `DefaultClientRequestContext.whenIntialized()` after `initContextAndExecuteWithFallback` of `ClientUtil` Result: - You no longer see `ClosedStreamException` when an `EndpointGroup` is empty. - Fixes #3381
heowc
pushed a commit
to heowc/armeria
that referenced
this issue
Jun 24, 2021
…nitializing a context (line#3636) Motivation: `LazyDynamicEndpointGroupTest.emptyEndpoint()` sometimes failed in CI builds. line#3381 It expects to fail the test with `EmptyEndpointException`, however, it fails with `ClosedStreamException`. After digging the issue, I find out that there is a race in `whenInitialized`. If the `acquiredEventLoop.execute()` is executed immediately and completed earlier than returning the method, https://github.com/line/armeria/blob/d4880fe12690d2dafd2c5e7fa9f24c3b24837a00/core/src/main/java/com/linecorp/armeria/client/DefaultClientRequestContext.java#L307-L309 the callbacks of `ctx.whenInitialized()` will be invoked before a `RequestLog` is completed. https://github.com/line/armeria/blob/207c5e038f59802dca769936a50e219a5fe308ea/grpc/src/main/java/com/linecorp/armeria/internal/client/grpc/ArmeriaClientCall.java#L337-L348 As the `req` is closed already, the `req.write()` would be failed with `ClosedStreamException`. Modifications: - Complete `DefaultClientRequestContext.whenIntialized()` after `initContextAndExecuteWithFallback` of `ClientUtil` Result: - You no longer see `ClosedStreamException` when an `EndpointGroup` is empty. - Fixes line#3381
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: