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

Write Operations Performance improvements #18578

Merged
merged 1 commit into from
Jan 15, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1164,7 +1164,7 @@ private boolean offerChannel(final Channel channel) {
private Channel pollChannel() {
ensureInEventLoop();

final Channel first = this.availableChannels.pollLast();
final Channel first = this.availableChannels.pollFirst();

if (first == null) {
return null; // because there are no available channels
Expand All @@ -1182,7 +1182,7 @@ private Channel pollChannel() {

this.availableChannels.offer(first); // because we need a non-null sentinel to stop the search for a channel

for (Channel next = this.availableChannels.pollLast(); next != first; next = this.availableChannels.pollLast()) {
for (Channel next = this.availableChannels.pollFirst(); next != first; next = this.availableChannels.pollFirst()) {
assert next != null : "impossible";

if (next.isActive()) {
Expand Down