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

After clientsession created, runEventLoop cannot get a session established? #9

Closed
cwk32 opened this issue Oct 14, 2014 · 4 comments
Closed
Labels

Comments

@cwk32
Copy link

cwk32 commented Oct 14, 2014

we successfully run lv1 example, about 25.6G approxiamately, including calculating

but when we turn to lv2 example, the calculation of which is bigger, we find the following problem:

After client session is started, and we run eqh.runEventLoop(1, -1), it gets no established signal and stop. After this session, all the following session shares the same problem.

actually what they get is a SESSION_CLOSED! why!

@cwk32
Copy link
Author

cwk32 commented Oct 14, 2014

the logging is INFO, and we do not find some other error messages nearby

@rosenbaumalex
Copy link
Collaborator

As explained in Closing an Active Session wiiki page, closing the first session will be completed once the SESSION_CLOSED event is received.
Your code did not wait for this SESSION_CLOSE event on the 1st session and continued quickly to the 2nd session. Once you called eqh.runEventLoop(1, -1) you enabled the JXIO progress engine to complete the closing of the first session properly. But because you waited for only 1 event your code exited the runEventLoop() before receiving the new session established event.

This mode of work on the two sessions in parallel is perfectly OK as long as you take this into account in your code.
So you start the 2nd session, and wait for it's establishment, while anticipating that the previous session close event might be deliver any time.
We recommend using a separate callback instance, like you did in this example, this will allow you to easily distinguish between the new and old sessions. Then you need to wait for additional events until you get the established event on your new session. You can loop over runEventLoop(1,-1) or wait for multiple events and call eqh.breakEventLoop() from established callback.
At the end of the program, calling eqh.close(), will block until all session are fully closed.

@rosenbaumalex
Copy link
Collaborator

Additional performance related point to consider is to try and keep as many object a live for multiple sessions. This object caching consideration will improve performance.
Creating a new MsgPool requires mapping of memory between RDMA and Java and consume time. Creating a single MsgPool which will be re-used by several consequential ClientSession is the recommended mode of work.

The JxioConnection uses a caching class: JxioResourceManager

See the newly added Performance Considerations wiki page

@cwk32 cwk32 closed this as completed Oct 17, 2014
@cwk32
Copy link
Author

cwk32 commented Oct 18, 2014

as the manager suggests,

summary as follow:

make it a -1 -1 route
when receive established, break the event loop

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants