[KAFKA-370] Fix resource management in MongoSourceTask, MongoSinkTask Created: 12/May/23  Updated: 28/Oct/23  Resolved: 17/May/23

Status: Closed
Project: Kafka Connector
Component/s: Source
Affects Version/s: 1.9.0
Fix Version/s: 1.10.1

Type: Bug Priority: Critical - P2
Reporter: Valentin Kavalenka Assignee: Valentin Kavalenka
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Documented
Duplicate
is duplicated by KAFKA-368 MongoDB source connector (>1.9.0) doe... Closed
Problem/Incident
is caused by KAFKA-330 Source Connector ChangeStream support... Closed
Related
Documentation Changes: Needed
Documentation Changes Summary:

We need to mention in What's new that we fixed a bug that caused resource leak if source/sink tasks fail to start.


 Description   

Refactoring I did in the source connector 1.9.0 introduced a resource leak: if MongoSourceTask.start fails, then neither StatisticsManager, nor MongoCopyDataManager, nor, most importantly, MongoClient get closed. Not only this causes the leak on the connector-side, but also on the server-side, as MongoClient keeps maintaining/re-creating monitoring connections (at the very least) with the server.



 Comments   
Comment by Githook User [ 17/May/23 ]

Author:

{'name': 'Valentin Kovalenko', 'email': 'valentin.kovalenko@mongodb.com', 'username': 'stIncMale'}

Message: Fix resource management in `MongoSourceTask`, `MongoSinkTask` (#138)

KAFKA-370
Branch: 1.10.x
https://github.com/mongodb/mongo-kafka/commit/f0923d480cc01ae64ff03ece43ef08f9c0e5776f

Comment by Githook User [ 17/May/23 ]

Author:

{'name': 'Valentin Kovalenko', 'email': 'valentin.kovalenko@mongodb.com', 'username': 'stIncMale'}

Message: Fix resource management in `MongoSourceTask`, `MongoSinkTask` (#138)

KAFKA-370
Branch: master
https://github.com/mongodb/mongo-kafka/commit/003f6d981d85dfe96b6ffd4c3690a38eab57315d

Generated at Thu Feb 08 09:06:13 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.