You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/01/14 11:24:19 UTC
[GitHub] [camel] rgala opened a new pull request #6751: CAMEL-17489: camel-kafka - Unsubscribe before closing the consumer
rgala opened a new pull request #6751:
URL: https://github.com/apache/camel/pull/6751
<!-- Uncomment and fill this section if your PR is not trivial
- [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it). Trivial changes like typos do not require a JIRA issue. Your pull request should address just this issue, without pulling in other changes.
- [ ] Each commit in the pull request should have a meaningful subject line and body.
- [ ] If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
- [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [ ] Run `mvn clean install -Psourcecheck` in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
Below are the contribution guidelines:
https://github.com/apache/camel/blob/main/CONTRIBUTING.md
-->
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] orpiske merged pull request #6751: CAMEL-17489: camel-kafka - Unsubscribe before closing the consumer
Posted by GitBox <gi...@apache.org>.
orpiske merged pull request #6751:
URL: https://github.com/apache/camel/pull/6751
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] orpiske commented on pull request #6751: CAMEL-17489: camel-kafka - Unsubscribe before closing the consumer
Posted by GitBox <gi...@apache.org>.
orpiske commented on pull request #6751:
URL: https://github.com/apache/camel/pull/6751#issuecomment-1013317518
I am merging this, and then I'll improve the `safeUnsubscribe`.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] orpiske commented on a change in pull request #6751: CAMEL-17489: camel-kafka - Unsubscribe before closing the consumer
Posted by GitBox <gi...@apache.org>.
orpiske commented on a change in pull request #6751:
URL: https://github.com/apache/camel/pull/6751#discussion_r784779315
##########
File path: components/camel-kafka/src/main/java/org/apache/camel/component/kafka/KafkaFetchRecords.java
##########
@@ -212,6 +212,7 @@ protected void startPolling() {
// only close if not retry
if (!isRetrying()) {
LOG.debug("Closing consumer {}", threadId);
+ safeUnsubscribe();
Review comment:
An exception here might trigger the exception handler ... but I guess it's OK.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] orpiske commented on pull request #6751: CAMEL-17489: camel-kafka - Unsubscribe before closing the consumer
Posted by GitBox <gi...@apache.org>.
orpiske commented on pull request #6751:
URL: https://github.com/apache/camel/pull/6751#issuecomment-1013132826
> I think `safeUnsubscribe` should be made _safe_ and deal with already closed, eg kafka throws this
>
> ```
> private void acquireAndEnsureOpen() {
> acquire();
> if (this.closed) {
> release();
> throw new IllegalStateException("This consumer has already been closed.");
> }
> }
> ```
>
> eg make safeUnsubscrive catch IllegalStateException and ignore that
Yeah, I think it may be OK to ignore the `IllegalStateException` in this specific case. I think there are other issues that could happen during unsubscribe, so we need to be careful to ignore only that IMHO.
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [camel] davsclaus commented on pull request #6751: CAMEL-17489: camel-kafka - Unsubscribe before closing the consumer
Posted by GitBox <gi...@apache.org>.
davsclaus commented on pull request #6751:
URL: https://github.com/apache/camel/pull/6751#issuecomment-1013109427
I think `safeUnsubscribe` should be made _safe_ and deal with already closed, eg kafka throws this
```
private void acquireAndEnsureOpen() {
acquire();
if (this.closed) {
release();
throw new IllegalStateException("This consumer has already been closed.");
}
}
```
eg make safeUnsubscrive catch IllegalStateException and ignore that
--
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: commits-unsubscribe@camel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org