-
Notifications
You must be signed in to change notification settings - Fork 106
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
Proposed fix for issue #414 #428
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, lets wait for @valdar
Thanks. For context and future reference, here's some numbers from a test I ran on Friday: #414 (comment) |
@orpiske can you please rebase so your branch will pick up the newly poiting to master gh actions? Thanks |
Sure thing. |
This adds a reference implementation for checking the resource usage of the RabbitMQ component while iddle. The motivation for this is related to the github issue apache#414.
b4143e6
to
4b7b0f6
Compare
I think it should be ok now, @oscerd |
Thanks, I think @valdar is reviewing. |
Hi @orpiske great work! I was wondering which one of the contributions is predominant: better handling the remaining time or returning Do you mind, since you already have the performance tests at hand, doing a quick comparison towards just returning |
core/src/main/java/org/apache/camel/kafkaconnector/CamelSourceTask.java
Outdated
Show resolved
Hide resolved
Thanks! And thanks for the review!
The biggest gain is related to avoiding the busy spin. On the previous code we were returning immediately from the receiveNoWait and so the loop was running thousands of times per poll. The change replaces the busy spin with a direct call to the receive, blocking for at most
I tried with returning the null as well. I have a flame graph with that test with null available here. It doesn't seem to affect the performance, but I changed it nonetheless because that way it complies with the connect API. |
This modifies the code so that it blocks while waiting for the messages to arrive while also respecting the maxPollDuration.
4b7b0f6
to
4bcba9f
Compare
@orpiske thanks for the insight on this, I thought it was something similar but I just wanted to be sure. |
I believe after merging this we could cut a 0.5.0 release |
+1 from me. I think we could start preparing that. |
Looks like everything is alright: approvals OK, CI ok. So, merging this one. |
No description provided.