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

Consumer: reduce timer allocations #712

Merged
merged 1 commit into from
Jul 26, 2016
Merged

Conversation

eapache
Copy link
Contributor

@eapache eapache commented Jul 26, 2016

Rather than allocating a new timer with time.After on every message we
consume, allocate one for the responseFeeder and just keep resetting it.
Thanks to @Tevic for suggesting this approach.

Fixes #707 cc @Dieterbe.

Rather than allocating a new timer with `time.After` on every message we
consume, allocate one for the `responseFeeder` and just keep resetting it.
Thanks to @Tevic for suggesting this approach.

Fixes #707.
@Dieterbe
Copy link
Contributor

as i mentioned in the other ticket, profile looks a lot better, and it looks like my app still consumes data fine as well ;)

@eapache eapache merged commit fde67d3 into master Jul 26, 2016
@eapache eapache deleted the reduce-timer-allocations branch July 26, 2016 17:01
@Dieterbe
Copy link
Contributor

thanks @Tevic for your suggestion and @eapache for taking care of it so quickly! Will roll this out soon :)

Dieterbe added a commit to grafana/metrictank that referenced this pull request Jul 27, 2016
pulled in the dependencies how i had them in my $GOPATH
in particular it comes with a Sarama allocation fix
IBM/sarama#712
@eapache eapache mentioned this pull request Aug 12, 2016
@leemingtian
Copy link

Hi guys. I think the timer was used incorrectly here. As mentioned in the package document, we should call timer's Stop method before reuse a timer. Link. And the current codes lead to logs like "abandoned subscription to Topic because consuming was taking too long".

@eapache
Copy link
Contributor Author

eapache commented Aug 30, 2016

Yes, #733 and #734 already addressed the issue on master. I am just prepping to release a new version with those fixes and one other.

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.

3 participants