Skip to content

Commit

Permalink
Scolletd: Exit the sending loop when full
Browse files Browse the repository at this point in the history
When the scollectd fills its buffer it should exist the nested loops
completely.
Curently the break only exit only the iner loop which cause the collectd
to report only partial of the metrics.

See scylladb/scylladb#2400
  • Loading branch information
amnonh committed May 29, 2017
1 parent aeb437c commit 78211d4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/scollectd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,8 @@ void impl::run() {

out.clear();

while (m_itartor != vals->end()) {
bool out_of_space = false;
while (!out_of_space && m_itartor != vals->end()) {
while (i != m_itartor->second.end()) {
if (i->type() == seastar::metrics::impl::data_type::HISTOGRAM) {
++i;
Expand All @@ -421,10 +422,14 @@ void impl::run() {
out.put(_host, _period, std::get<seastar::metrics::impl::register_ref>(*i)->get_id(), std::get<seastar::metrics::impl::metric_value>(*i));
if (!out) {
out.reset(m);
out_of_space = true;
break;
}
++i;
}
if (out_of_space) {
break;
}
++m_itartor;
if (m_itartor != vals->end()) {
i = m_itartor->second.begin();
Expand Down

0 comments on commit 78211d4

Please sign in to comment.