wchevreuil opened a new pull request, #184: URL: https://github.com/apache/hbase-connectors/pull/184
Spark creates a DataWriter outside its failure handling and registers a PartitionReader's close() only after createReader returns, so resources taken by a constructor that throws were never released. HBaseDataWriter and HBasePartitionReader took a cached connection before validating their schema, and the reader also opened its table and scanners eagerly, so a bad column, invalid time options or a failed getScanner leaked them. HBaseDataWriter also released the table and connection in both commit() and abort(). Spark calls abort() after a failed commit(), so the shared connection's reference count could drop twice and the cache could close it under other tasks. Neither class guarded its releases, so one failed close skipped the rest. Validate before acquiring resources, and release what was acquired when construction fails. The writer's commit() now only flushes and abort() only discards buffered puts. close(), which Spark always calls last, releases every resource once, continuing past failures and rethrowing the first. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
