Skip to content

Conversation

@zhenlineo
Copy link
Contributor

Before we always decrement idle counters when a channel is closed. However, this is wrong when a channel is closed before it is returen to the pool.
So change the code to make sure that no matter the channel is closed inside or outside the pool, the idle and inUse counters should be correct.

@zhenlineo zhenlineo requested a review from lutovich March 5, 2018 14:54
Zhen added 2 commits March 5, 2018 17:00
Before we always decrement idle counters when a channel is closed. However, this is wrong when a channel is closed before it is returen to the pool.
So change the code to make sure that no matter the channel is closed inside or outside the pool, the idle and inUse counters should be correct.
assertEquals( 0, tracker.idleChannelCount( address ) );

// When closed before session.close
channel.close();
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe channel.close().sync()?
Channel#close() is async and returns a future.

assertEquals( 1, tracker.idleChannelCount( address ) );

// When closed before acquire
channel.close();
Copy link
Contributor

Choose a reason for hiding this comment

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

channel.close().sync();

@zhenlineo zhenlineo merged commit c84c1c1 into neo4j:1.6 Mar 6, 2018
@zhenlineo zhenlineo deleted the 1.6-idle-counter branch March 6, 2018 09:25
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.

2 participants