Stratio/Spark-MongoDB

Connections leaking and actively sending commands on 0.12.0

ssimeonov opened this issue · 1 comments

Despite the multiple improvements to prevent connection leakage, I have observed a sharp spike in leaked connections moving to 0.12.0 from 0.11.2 (the migration is required by our move to Spark 2.x).

Here is what happened after the upgrade.

0.12.0

The steps happen when we run a scheduled Spark job that pulls 15+ collections from Mongo. The drops are cluster restarts for library upgrades.

Zooming out, here what the situation looked like under 0.11.2 before the upgrade to 0.12.0.

0.11.2

Since 0.12.0 is the only release compatible with Spark 2.x, there is nothing to downgrade to.

Interestingly, calling MongodbClientFactory.closeAll() after the job is done only removes 50% of the leaked connections.

after closeAll()