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

Queue depth limit, i.e. asyncQueuedSize is not always respected #32

Closed
erdunn opened this issue Jan 8, 2016 · 1 comment
Closed

Queue depth limit, i.e. asyncQueuedSize is not always respected #32

erdunn opened this issue Jan 8, 2016 · 1 comment

Comments

@erdunn
Copy link

erdunn commented Jan 8, 2016

There appears to be a problem with kinetic-java/kinetic-client/src/main/java/com/seagate/kinetic/client/io/MessageHandler.java in the method writeAsync near line 325. The code in question is

        // synchronized (this) {
            while (this.ackmap.size() >= this.asyncQueuedSize && this.isRunning) {
                this.wait();
            // }
        }

This code is attempting to limit the queue size to asyncQueuedSize but because of the extra && this.isRunning clause, if the MessageHandler, i.e. this, isn't running or isn't running yet, then the queue can grow to arbitrary size.

This actually happens at the start of the microAsync method in the micro performance test.

I don't know why the && this.isRunningclause is here. I probably just don't understand. But without it, i.e. with just

        // synchronized (this) {
        while ( this.ackmap.size() >= this.asyncQueuedSize ) {
            this.wait();
            // }
        }

the queue size is correctly limited.

It seems broken as it is. Suggestions?

chiaming2000 added a commit that referenced this issue Jan 8, 2016
chenchongli added a commit that referenced this issue Jan 11, 2016
Fix for issue #32 - asyncQueuedSize is not always respected.
@erdunn
Copy link
Author

erdunn commented Jan 12, 2016

Thanks, Chiaming, your fix works for me.

@erdunn erdunn closed this as completed Jan 12, 2016
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

No branches or pull requests

1 participant