-
Notifications
You must be signed in to change notification settings - Fork 66
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
RdmaServerEndpoint accept may return null, if listening endpoint closes. #54
Open
BernardMetzler
wants to merge
1
commit into
zrlio:master
Choose a base branch
from
BernardMetzler:RdmaServerEpNullAccept
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PepperJo
suggested changes
Oct 5, 2020
if (endpoint != null) { | ||
logger.info("connect request received"); | ||
endpoint.accept(); | ||
} | ||
return endpoint; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we sure applications are handling the case correctly if null is returned here? Might as well throw an exception (Much like before)?
-----"Jonas Pfefferle" <[email protected]> wrote: -----
To: "zrlio/disni" ***@***.***>
From: "Jonas Pfefferle" ***@***.***>
Date: 10/05/2020 08:29AM
Cc: "Bernard Metzler" ***@***.***>, "Author"
***@***.***>
Subject: [EXTERNAL] Re: [zrlio/disni] RdmaServerEndpoint accept may
return null, if listening endpoint closes. (#54)
@PepperJo requested changes on this pull request.
In src/main/java/com/ibm/disni/RdmaServerEndpoint.java:
> @@ -130,8 +130,12 @@ public C accept() throws IOException {
}
}
C endpoint = requested.poll();
- logger.info("connect request received");
- endpoint.accept();
+
+ // a null endpoint gets returned if listening endpoint closes
+ if (endpoint != null) {
+ logger.info("connect request received");
+ endpoint.accept();
+ }
return endpoint;
Are we sure applications are handling the case correctly if null is
returned here? Might as well throw an exception (Much like before)?
No we are not sure. The patch would change the semantics of a server
endpoint, and applications would have to be aware of it. We run into
it, if we are terminating a server endpoint, which is still in its
accept call. Do we want to crash here, or give the application a chance
to handle that gracefully...
… —
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
But we don't really crash, we just throw an exception which can be
gracefully handled.
If we want the application to be able to distinguish we should make sure to
throw a different exception type.
On Mon, 05 Oct 2020 07:39:19 -0700
Bernard Metzler <[email protected]> wrote:
… -----"Jonas Pfefferle" ***@***.***> wrote: -----
>To: "zrlio/disni" ***@***.***>
>From: "Jonas Pfefferle" ***@***.***>
>Date: 10/05/2020 08:29AM
>Cc: "Bernard Metzler" ***@***.***>, "Author"
***@***.***>
>Subject: [EXTERNAL] Re: [zrlio/disni] RdmaServerEndpoint accept may
>return null, if listening endpoint closes. (#54)
>
>
> @PepperJo requested changes on this pull request.
> In src/main/java/com/ibm/disni/RdmaServerEndpoint.java:
> > @@ -130,8 +130,12 @@ public C accept() throws IOException {
> }
> }
> C endpoint = requested.poll();
>- logger.info("connect request received");
>- endpoint.accept();
>+
>+ // a null endpoint gets returned if listening endpoint closes
>+ if (endpoint != null) {
>+ logger.info("connect request received");
>+ endpoint.accept();
>+ }
> return endpoint;
> Are we sure applications are handling the case correctly if null is
>returned here? Might as well throw an exception (Much like before)?
No we are not sure. The patch would change the semantics of a server
endpoint, and applications would have to be aware of it. We run into
it, if we are terminating a server endpoint, which is still in its
accept call. Do we want to crash here, or give the application a
chance
to handle that gracefully...
> —
>You are receiving this because you authored the thread.
>Reply to this email directly, view it on GitHub, or unsubscribe.
>
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#54 (comment)
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closing the RdmaServerEndpoint in a current accept() lets a poll of the private accepting endpoint queue return null. This patch just avoids dereferencing that null endpoint during accept(). The caller of RdmaServerEndpoint.accept() must handle that case appropriately.