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

fix issue #41 #43

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix issue #41 #43

wants to merge 1 commit into from

Conversation

lynus
Copy link
Contributor

@lynus lynus commented Jan 23, 2019

introduce isResourceAllocated() and support reconnect.

introduced isResourceAllocated and isError. Support reconnect.
Copy link
Collaborator

@yuvaldeg yuvaldeg left a comment

Choose a reason for hiding this comment

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

+1

IbvContext context = endpoint.getIdPriv().getVerbs();
RdmaActiveCqProcessor<C> cqProcessor = cqMap.get(context.getCmd_fd());
cqProcessor.unregister(endpoint);
}
Copy link
Member

@patrickstuedi patrickstuedi Jan 23, 2019

Choose a reason for hiding this comment

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

Why do we allow partially allocated ActiveEndpoints to call close() in the first place, only to then check if they have been allocated and prevent the close from proceeding? Rather I suggest we check the allocation state in the endpoint and decide whether or not to de-allocate.

That being said, I'm not convinced that preventing close on partially allocated enpoints is a good idea. What if I do want to close and cleanup the resources? I can't do so anymore. Also, this leaves partially allocated endpoints in the group, lingering around forever. I think we should leave it to the application to decide whether they want to close or not, then then make sure the close call closes whatever needs to be closed while not closing what doesn't need to.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My intention is not to prevent closing partial allocated endpoints, but to prevent releasing un-allocated resource when users decide to close the failed ep.

Rather I suggest we check the allocation state in the endpoint and decide whether or not to de-allocate.

This is exactly what I am trying to achieve by introducing isResourceAllocated(). Application ep's close() implementation should be the following pattern:
super.close();
if (isResourceAllocated())
release its own resources...

Check if resources has been successfully allocated before releasing its own resources. super.close() can be called without checking is because current close() of RdmaEndpoint works fine with partial allocated ep, and RdmaActiveEndpoint's needs the patch you quoted above to work.

Also, this leaves partially allocated endpoints in the group, lingering around forever.

This is not the case. Since ep throws exceptions before allocating resources

group.allocateResourcesRaw(this);

this ep never registered into cqProcessor. It is also unregistered from group's clientEndpointMap in
group.unregisterClientEp(this);

Therefore, no residues left after close().

In summary, users have to choices when catching exception on connect(): 1) close the failed ep and 2) try to connect() again. I think the patch can properly preventing releasing un-allocated resources if users decide to take opt-1. And the logic in connect() can handle the opt-2 situation.

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.

3 participants