Just FYI
Alan Bateman
Alan.Bateman at Sun.COM
Sat May 3 09:26:07 PDT 2008
Arkadiy Sutchilin wrote:
> Hi Alan,
>
> I've discovered, that there may be some delay between the cancel(true)
> return and the appropriate IoFuture update. E.g. the code below MAY
> fail (and actually failed from time to time, while rarely):
>
> boolean cancelled = future.cancel(true);
> if (cancelled && !future.isDone()) {
> return Status.failed(...);
> }
>
> :
Sorry about that - it was an oversight that I missed in the
implementation and only noticed it when you exposed how IoFuture
violates contract for cancel. The technical reason is of course that the
forceful cancel is closing the channel but isn't setting the result or
waiting for the result to be set. I've fixed this and so it will be
included in the next drop and build (probably after JavaOne as there is
too much going on just now).
-Alan.
More information about the nio-dev
mailing list