BlockHound integration

Description

The driver claims to be "fully non-blocking" if only asynchronous execution is used, but when BlockHound is enabled, a few blocking calls are detected:

  1. com.datastax.oss.driver.internal.core.time.Clock#getInstance when JNI is activated

  2. com.datastax.oss.driver.internal.core.context.DefaultNettyOption: constructor and onClose method, because of HashedWheelTimer, see https://github.com/netty/netty/pull/10810.

  3. com.datastax.oss.driver.api.core.uuid.Uuids#random, this will be solved by JAVA-2449.

Also, BlockHound considers ReentrantLock.lock() as a blocking call, and several driver components are affected.

We should clarify what calls are really dangerous for non-blocking applications:

  1. Add a page to the manual to clarify how to use BlockHound and what API methods are safe to use;

  2. Add some BlockHound exceptions to methods that should always be allowed to block momentarily:

    1. Session Initialization participants should be allowed to block

    2. Calls to ReentrantLock.lock should be allowed where absolutely required for the driver to work properly, and expected lock contention is low (i.e. the thread won't be blocked indefinitely).

Environment

None

Pull Requests

None
Fixed

Assignee

Alexandre Dutra

Reporter

Alexandre Dutra

Labels

None

PM Priority

None

Affects versions

None

Fix versions

Pull Request

None

Doc Impact

None

Size

None

External issue ID

None

External issue ID

None

Priority

Major
Configure