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

Change to shutdown the connection directly in case the server do not participate close. #212

Merged
merged 4 commits into from
Mar 29, 2022

Conversation

incfly
Copy link

@incfly incfly commented Mar 25, 2022

Fixes #211

After this PR, the issue is resolved.

Signed-off-by: Jianfei Hu <[email protected]>
Signed-off-by: Jianfei Hu <[email protected]>
@incfly
Copy link
Author

incfly commented Mar 25, 2022

@dio in case @Shikugawa is not avaialable.

// directly. We choose not to use `ssl_stream::async_shutdown` since in some
// case, the HTTPS server does not participate with closing
// stream/connection. That would make the async_shutdown waiting forever.
beast::get_lowest_layer(stream).close();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I got the cause of this change. This problem is rooted from asio's implementation and I think it is better to use timeout to wait ack of close_notify message. (But async_shutdown doesn't have this feature. ref chriskohlhoff/asio#650)
My proposal is to note that this fix is like a workaround here and may be fixed in future work.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like the timeout idea.

Copy link
Author

Choose a reason for hiding this comment

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

I saw that post as well. And my initial attempt, eeb5776 was trying to use a timer, but I didn't managed to get it work properly, lack of C++ and boost familiarity ... :(

Added a tracker and a TODO. #214

Copy link
Collaborator

@Shikugawa Shikugawa Mar 29, 2022

Choose a reason for hiding this comment

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

I think that eeb5776 won't work because the timer callback won't be executed before async_shutdown will have done ;) This is why we should wait the fix of boost/asio internal. Thanks.

src/common/http/http.cc Show resolved Hide resolved
Signed-off-by: Jianfei Hu <[email protected]>
@istio-testing
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: incfly, Shikugawa

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@istio-testing istio-testing merged commit 771d406 into istio-ecosystem:master Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

integration with ADFS fails due to unable to shutdown connection for ssl stream
4 participants