You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Marcelo Vanzin (JIRA)" <ji...@apache.org> on 2018/10/04 16:24:00 UTC

[jira] [Resolved] (CRYPTO-135) CryptoOutputStream is always blocking

     [ https://issues.apache.org/jira/browse/CRYPTO-135?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcelo Vanzin resolved CRYPTO-135.
-----------------------------------
    Resolution: Won't Fix

See discussion in the PR for this:
https://github.com/apache/commons-crypto/pull/74

Short summary: it's very hard to provide non-blocking semantics and still return reasonable values to the callers of the WritableByteChannel API. So instead I just commented on the class javadocs that they should only be used with blocking I/O.

> CryptoOutputStream is always blocking
> -------------------------------------
>
>                 Key: CRYPTO-135
>                 URL: https://issues.apache.org/jira/browse/CRYPTO-135
>             Project: Commons Crypto
>          Issue Type: Bug
>          Components: Stream
>    Affects Versions: 1.1.0
>            Reporter: Marcelo Vanzin
>            Priority: Major
>
> CRYPTO-125 described a bug where not all data written to the CryptoOutputStream would make it to the underlying channel if that channel was non-blocking.
> The fix added in that bug makes CryptoOutputStream blocking by doing a busy loop. This makes it a poor match (not to say unusable) for applications that use non-blocking channels, since it will turn non-blocking streams into blocking streams that waste a lot of CPU.
> Instead, CryptoOutputStream should correctly implement non-blocking semantics in its implementation of WritableByteChannel.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)