Client library: implement "best effort" attempt to relinquish read lease on chunk reader shutdown by submitting and immediately canceling lease relinquish RPC. With meta server connection established and authenticated this should "put on the wire" the RPC request, the protocol state machine will discard the response for the canceled RPC. With no connection doing so will not relinquish the lease. In most cases the lease relinquish should work, except the cases where the meta server connection is closed due to "idle" timeout. While it is possible to create a new lease relinquish rpc with no "owner" to make lease release with re-connect, the connection idle timeout is comparable with the lease timeout, and presently file "overwrite" used rarely. Therefore, presently, the complexity increase, albeit minor, to create a new / "stadalone" RPC doesn't seem to be warranted.
Use reader shutdown instead of close in the kfs client's file descriptor close path to minimize "closing" time in the cases with in flight read ahead, especially when read ahead request has to be canceled waits for the chunk read(s) completion. The alternative to implement asynchronous chunk reader close seems less attractive as it might effectively increase number of open file descriptors in the cases where open / read / close frequency is high, and would require complexity increase.
Change kfs protocol state machine reply discard message level from info to debug, which seems more appropriate, and will reduce the chances of alarming users.