return false;
};
- SimpleBackoff shard_lock(5 /* max retries */, 50ms);
+ // retrying longer, so that you wait for at least for |max_lock_secs| which
+ // has a default value of 90 seconds.
+ SimpleBackoff shard_lock(50 /* max retries */, 50ms);
if (! shard_lock.wait_backoff(lock_lambda)) {
ldpp_dout(this, 0) << "RGWLC::process(): failed to acquire lock on "
<< lc_shard << " after " << shard_lock.get_retries()
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::process() failed to get obj head "
<< lc_shard << ", ret=" << ret << dendl;
- goto exit;
+ break;
}
/* if there is nothing at head, try to reinitialize head.marker with the
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::process() sal_lc->list_entries(lc_shard, head.marker, 1, "
<< "entries) returned error ret==" << ret << dendl;
- goto exit;
+ break;
}
if (entries.size() > 0) {
entry = std::move(entries.front());
tmp_entry.bucket = head.marker;
if (update_head(lc_shard, head, tmp_entry, now, worker->ix) != 0) {
- goto exit;
+ break;
}
continue;
}
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::process() sal_lc->get_entry(lc_shard, head.marker, entry) "
<< "returned error ret==" << ret << dendl;
- goto exit;
+ break;
}
}
<< " index: " << index << " worker ix: " << worker->ix << dendl;
/* skip to next entry */
if (update_head(lc_shard, head, entry, now, worker->ix) != 0) {
- goto exit;
- }
+ break;
+ }
continue;
}
} else {
<< dendl;
/* skip to next entry */
if (update_head(lc_shard, head, entry, now, worker->ix) != 0) {
- goto exit;
- }
- continue;
- }
+ break;
+ }
+ continue;
+ }
}
} else {
ldpp_dout(this, 5) << "RGWLC::process() entry.bucket.empty() == true at START 1"
<< " (this is possible mainly before any lc policy has been stored"
<< " or after removal of an lc_shard object)"
<< dendl;
- goto exit;
+ break;
}
/* When there are no more entries to process, entry will be
if (ret < 0) {
ldpp_dout(this, 0) << "RGWLC::process() failed to set obj entry "
<< lc_shard << entry.bucket << entry.status << dendl;
- goto exit;
+ break;
}
/* advance head for next waiter, then process */
if (advance_head(lc_shard, head, entry, now) < 0) {
- goto exit;
+ break;
}
ldpp_dout(this, 5) << "RGWLC::process(): START entry 2: " << entry
<< lc_shard << " entry=" << entry
<< dendl;
/* fatal, locked */
- goto exit;
+ break;
}
}
- if (check_if_shard_done(lc_shard, head, worker->ix) != 0 ) {
- goto exit;
+ if (check_if_shard_done(lc_shard, head, worker->ix) != 0) {
+ break;
}
} while(1 && !once && !going_down());
-exit:
lock->unlock(this, null_yield);
return 0;
}