Issue:
For source connector, when configured with maxTasks > 1, only 1 tasks will run successfully, others will fail.
Root cause:
currently when there are multiple tasks configured, all of them will try to create the lease container, but only 1 will succeeded, others will fail.
Fixes:
Move the lease container creation into CosmosDBSourceConnector
Other changes included:
During task.stop(), adding some delays for closing cosmosClient as the PartitionProcessor will release the leases in the background.
Issue: For source connector, when configured with maxTasks > 1, only 1 tasks will run successfully, others will fail.
Root cause: currently when there are multiple tasks configured, all of them will try to create the lease container, but only 1 will succeeded, others will fail.
Fixes: Move the lease container creation into
CosmosDBSourceConnector
Other changes included: During task.stop(), adding some delays for closing cosmosClient as the PartitionProcessor will release the leases in the background.