Skip to content

Conversation

@Markliniubility
Copy link
Member

Fixes #3307.

Motivation

It is possible that the Kafka consumer will be closed twice. It will raise an IllegalStateException when being closed again.

Modifications

Since we call consumer.close() in ConsumerImpl.java. The consumer is already closed. In the final shutdown of eventmesh, the finally section of code in the KafkaConsumerRunner will also be called, resulting in closing the consumer twice.

As a result, I modify the code to call the shutdown method in the KafkaRunner, and then shut down the executor to prevent the executor from running forever.

Documentation

  • Does this pull request introduce a new feature? (yes / no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)
  • If a feature is not applicable for documentation, explain why?
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@Markliniubility Markliniubility requested a review from xwm1992 March 1, 2023 11:08
@codecov
Copy link

codecov bot commented Mar 1, 2023

Codecov Report

Merging #3308 (b53aaf3) into master (6636e3a) will decrease coverage by 0.02%.
The diff coverage is 0.00%.

❗ Current head b53aaf3 differs from pull request most recent head 7d37d23. Consider uploading reports for the commit 7d37d23 to get more accurate results

@@             Coverage Diff              @@
##             master    #3308      +/-   ##
============================================
- Coverage     13.09%   13.08%   -0.02%     
  Complexity     1159     1159              
============================================
  Files           550      550              
  Lines         28718    28710       -8     
  Branches       2854     2841      -13     
============================================
- Hits           3761     3756       -5     
+ Misses        24632    24631       -1     
+ Partials        325      323       -2     
Impacted Files Coverage Δ
...entmesh/connector/kafka/consumer/ConsumerImpl.java 0.00% <0.00%> (ø)
...ventmesh/client/grpc/util/EventMeshClientUtil.java 91.20% <0.00%> (-0.34%) ⬇️
...rg/apache/eventmesh/runtime/trace/LogExporter.java 0.00% <0.00%> (ø)
...ime/admin/handler/RedirectClientByPathHandler.java 84.78% <0.00%> (ø)
...e/admin/handler/RedirectClientByIpPortHandler.java 31.37% <0.00%> (ø)
.../tcp/client/session/push/DownStreamMsgContext.java 0.00% <0.00%> (ø)
...l/tcp/client/recommend/EventMeshRecommendImpl.java 0.83% <0.00%> (+<0.01%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@xwm1992 xwm1992 merged commit 984537d into master Mar 2, 2023
@qqeasonchen qqeasonchen deleted the Kafka-Shutdown branch March 30, 2023 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Kafka Consumer Closing Twice

2 participants