Stop OffsetStore when stopping the connector - #12457
Merged
Merged
Conversation
Contributor
|
@dlg99:Thanks for your contribution. For this PR, do we need to update docs? |
Contributor
|
@dlg99:Thanks for providing doc info! |
hangc0276
approved these changes
Oct 22, 2021
| log.info("Stopping PulsarOffsetBackingStore"); | ||
| if (null != producer) { | ||
| try { | ||
| producer.flush(); |
Contributor
There was a problem hiding this comment.
Can we put the flush and close in the same try-catch block?
Contributor
Author
There was a problem hiding this comment.
@hangc0276 in that case exception from flush prevent close(). We do want to close the producer.
Contributor
|
it looks like a test is failing due to this patch |
Contributor
Author
|
@eolivelli fixed. I did the patch on 2.7 branch originally, in master the client is passed through the context and should not be closed by the connector. |
codelipenghui
approved these changes
Oct 24, 2021
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
Oct 25, 2021
### Motivation Source connectors based on KCA (all debezium ones) don't stop properly on error / don't restart. apache#12441 fixes one problem, this PR fixes another: ofsetStore is not closed on connector stop() and producer/consumer aren't closed too, preventing the connector from shutting down. ### Modifications Closing offset store on connector stop. (cherry picked from commit 63454e9)
nicoloboschi
pushed a commit
to datastax/pulsar
that referenced
this pull request
Oct 25, 2021
Source connectors based on KCA (all debezium ones) don't stop properly on error / don't restart. apache#12441 fixes one problem, this PR fixes another: ofsetStore is not closed on connector stop() and producer/consumer aren't closed too, preventing the connector from shutting down. Closing offset store on connector stop. (cherry picked from commit 63454e9)
zeo1995
pushed a commit
to zeo1995/pulsar
that referenced
this pull request
Oct 25, 2021
* up/master: (46 commits) [website][upgrade]feat: docs migration - version-2.7.2 Pulsar Schema (apache#12393) [docs] io-develop, fix broken link (apache#12414) docs(function): fix incorrect classname in python runtime sample (apache#12476) Remove redundant null check for getInternalListener (apache#12474) Fix the retry topic's `REAL_TOPIC` & `ORIGIN_MESSAGE_ID` property should not be modified once it has been written. (apache#12451) [cli] Fix output format of string by pulsar-admin command (apache#11878) fix the race of delete subscription and delete topic (apache#12240) fix influxdb yaml doc (apache#12460) [Modernizer] Add Maven Modernizer plugin in pulsar-proxy module (apache#12326) fix DefaultCryptoKeyReaderTest can not run on windows (apache#12475) apache#12429 only fixed the compactor skips data issue, but the normal reader/consumer (apache#12464) broker resource group test optimize fail msg (apache#12438) Stop OffsetStore when stopping the connector (apache#12457) fix a typo in UnAckedMessageTracker (apache#12467) docs(function): fix typo in pip install (apache#12468) Optimize the code: remove extra spaces (apache#12470) optimize SecurityUtility code flow (apache#12431) Update lombok to 1.18.22 (apache#12466) Update team.js to add David K. as a committer (apache#12440) Fix java demo error in reset cursor admin (apache#12454) ... # Conflicts: # site2/website-next/versioned_docs/version-2.7.2/schema-evolution-compatibility.md # site2/website-next/versioned_docs/version-2.7.2/schema-get-started.md # site2/website-next/versioned_docs/version-2.7.2/schema-manage.md # site2/website-next/versioned_docs/version-2.7.2/schema-understand.md # site2/website-next/versioned_sidebars/version-2.7.2-sidebars.json
hangc0276
pushed a commit
that referenced
this pull request
Nov 4, 2021
Source connectors based on KCA (all debezium ones) don't stop properly on error / don't restart. #12441 fixes one problem, this PR fixes another: ofsetStore is not closed on connector stop() and producer/consumer aren't closed too, preventing the connector from shutting down. Closing offset store on connector stop. (cherry picked from commit 63454e9)
eolivelli
pushed a commit
that referenced
this pull request
Nov 9, 2021
### Motivation Source connectors based on KCA (all debezium ones) don't stop properly on error / don't restart. #12441 fixes one problem, this PR fixes another: ofsetStore is not closed on connector stop() and producer/consumer aren't closed too, preventing the connector from shutting down. ### Modifications Closing offset store on connector stop. (cherry picked from commit 63454e9)
eolivelli
pushed a commit
to eolivelli/pulsar
that referenced
this pull request
Nov 29, 2021
### Motivation Source connectors based on KCA (all debezium ones) don't stop properly on error / don't restart. apache#12441 fixes one problem, this PR fixes another: ofsetStore is not closed on connector stop() and producer/consumer aren't closed too, preventing the connector from shutting down. ### Modifications Closing offset store on connector stop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Source connectors based on KCA (all debezium ones) don't stop properly on error / don't restart.
#12441 fixes one problem, this PR fixes another: ofsetStore is not closed on connector stop() and producer/consumer aren't closed too, preventing the connector from shutting down.
Modifications
Closing offset store on connector stop.
Verifying this change
This change is a trivial rework / code cleanup without any test coverage.
Does this pull request potentially affect one of the following parts:
NO
If
yeswas chosen, please highlight the changesDocumentation
no-need-doc