Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoomKafkaProducer|Consumer let the background thread finish itself #4013

Conversation

maschmid
Copy link
Contributor

@maschmid maschmid commented Jul 29, 2024

Follows up to #3957 , but for LoomKafkaProducer, and unifies the approach

Instead of interrupting the BlockingQueue::take, we just use poll in the background thread, so we don't have to deal with interrupting the thread, so we now don't accidentally interrupt the actual processing of the queued tasks.

Instead of waiting for the Thread to be marked as "finished", we just wait by Thread::join. The only way it would block forever, is if the processing of the task would wait forever.

Proposed Changes

  • 🧹 LoomKafkaProducer|Consumer let the background thread finish itself

@knative-prow knative-prow bot requested review from creydr and lionelvillard July 29, 2024 11:42
@knative-prow knative-prow bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. area/data-plane labels Jul 29, 2024
Copy link

codecov bot commented Jul 29, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 48.25%. Comparing base (961961c) to head (7eb9c2a).
Report is 31 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4013   +/-   ##
=======================================
  Coverage   48.25%   48.25%           
=======================================
  Files         246      246           
  Lines       14540    14540           
=======================================
  Hits         7016     7016           
  Misses       6817     6817           
  Partials      707      707           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@maschmid
Copy link
Contributor Author

actually, we still need to interrupt the eventQueue.take()

@maschmid maschmid marked this pull request as draft July 29, 2024 12:53
@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 29, 2024
@maschmid maschmid force-pushed the maschmid-LoomKafkaProducer-close-wait-for-finish branch from e360777 to 7eb9c2a Compare July 29, 2024 13:19
@maschmid maschmid marked this pull request as ready for review July 29, 2024 13:25
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 29, 2024
@knative-prow knative-prow bot requested review from aliok and matzew July 29, 2024 13:25
@maschmid maschmid changed the title LoomKafkaProducer, wait for sendFromQueueThread to finish LoomKafkaProducer|Consumer let the background thread finish itself Jul 29, 2024
@maschmid
Copy link
Contributor Author

@maschmid
Copy link
Contributor Author

/test upgrade-tests

@maschmid
Copy link
Contributor Author

/test reconciler-tests-namespaced-broker
/test upgrade-tests

@matzew
Copy link
Contributor

matzew commented Sep 9, 2024

/test reconciler-tests-namespaced-broker

Copy link
Member

@pierDipi pierDipi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Sep 9, 2024
Copy link

knative-prow bot commented Sep 9, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: maschmid, pierDipi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 9, 2024
@knative-prow knative-prow bot merged commit 045f7e2 into knative-extensions:main Sep 9, 2024
33 checks passed
matzew pushed a commit to matzew/eventing-kafka-broker that referenced this pull request Apr 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/data-plane lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants