Before this commit, ReadCompletionHandler delayed closing the channel to allow an ongoing read to complete/fail so we can get a hold of the associated DataBuffer and release it. This can be problematic since the read take time to complete but even more importantly there was a race condition where we didn't check if we've been disposed concurrently while releasing the read flag. This commit removes the delay and closes the channel immediately from cancel() and that should in turn fail any ongoing read operation, according to AsynchronousChannel, and the DataBuffer is released. Further improvements include: - combining the "reading" and "disposed" AtomicBoolean's into a single "state" AtomicReference. - an optimistic check to remain in READING mode and avoid state switches when there is demand to continue reading. Closes gh-25831
Spring Framework 
This is the home of the Spring Framework: the foundation for all Spring projects. Collectively the Spring Framework and the family of Spring projects are often referred to simply as "Spring".
Spring provides everything required beyond the Java programming language for creating enterprise applications for a wide range of scenarios and architectures. Please read the Overview section as reference for a more complete introduction.
Code of Conduct
This project is governed by the Spring Code of Conduct. By participating, you are expected to uphold this code of conduct. Please report unacceptable behavior to spring-code-of-conduct@pivotal.io.
Access to Binaries
For access to artifacts or a distribution zip, see the Spring Framework Artifacts wiki page.
Documentation
The Spring Framework maintains reference documentation (published and source), Github wiki pages, and an API reference. There are also guides and tutorials across Spring projects.
Build from Source
See the Build from Source Wiki page and the CONTRIBUTING.md file.
Stay in Touch
Follow @SpringCentral, @SpringFramework, and its team members on Twitter. In-depth articles can be found at The Spring Blog, and releases are announced via our news feed.
License
The Spring Framework is released under version 2.0 of the Apache License.