The v2 of the java client leaks RxJava threads on shutdown

I think Schedulers.shutdown() should be called last but yeah that should do the trick.
However stopping of rx threads attempts to be graceful and should be given maybe a few hundred milliseconds to complete.

What did you observe exactly?

note: the CouchbaseEnvironment needs only be closed if you instantiated it yourself