cmick opened a new pull request #16333:
URL: https://github.com/apache/flink/pull/16333
## What is the purpose of the change
This pull request fixes a potential connection leak in RMQSource (issue
FLINK-23182). Currently the RabbitMQ connection is not closed properly in the
RMQSource connector in case of failures. This leads to a connection leak (we
loose handles to still opened connections) that will last until the Flink
TaskManager is either stopped or crashes.
## Brief change log
- `Connection#close` is called in `RMQSource#open` in case of a failure
- All resources are closed properly in `RMQSource#close`, and in case
there are multiple exceptions caught they are suppressed accordingly
## Verifying this change
This change added tests and can be verified as follows:
- `RMQSourceTest#testResourceCleanupOnOpenFailure`, which tests whether
the allocated resources all closed properly in case of a failure during
initialization (in `RMQSource#open`)
- `RMQSourceTest#testResourceCleanupOnClose`, which tests whether all
resources (consumer, channel, and connection) all closed properly even in case
of failure and all exception information is forwarded
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): (yes / **no**)
- The public API, i.e., is any changed class annotated with
`@Public(Evolving)`: (yes / **no**)
- The serializers: (yes / **no** / don't know)
- The runtime per-record code paths (performance sensitive): (yes / **no**
/ don't know)
- Anything that affects deployment or recovery: JobManager (and its
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (yes / **no** / don't
know)
- The S3 file system connector: (yes / **no** / don't know)
## Documentation
- Does this pull request introduce a new feature? (yes / **no**)
- If yes, how is the feature documented? (**not applicable** / docs /
JavaDocs / not documented)
--
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]