If a notify operation times out (all watchers to not ACK in time), include
an ETIMEDOUT in the final error message back to the client, so that they
know about it.
Signed-off-by: Sage Weil <sage@redhat.com>
in_progress_watchers(num_watchers),
complete(false),
discarded(false),
+ timed_out(false),
payload(payload),
timeout(timeout),
cookie(cookie),
return;
}
- in_progress_watchers = 0; // we give up TODO: we should return an error code
+ in_progress_watchers = 0; // we give up
+ timed_out = true; // we will send the client and error code
maybe_complete_notify();
assert(complete);
set<WatchRef> _watchers;
if (!in_progress_watchers) {
MWatchNotify *reply(new MWatchNotify(cookie, version, notify_id,
WATCH_NOTIFY, payload));
+ if (timed_out)
+ reply->return_code = -ETIMEDOUT;
osd->send_message_osd_client(reply, client.get());
unregister_cb();
complete = true;
unsigned in_progress_watchers;
bool complete;
bool discarded;
+ bool timed_out; ///< true if the notify timed out
set<WatchRef> watchers;
bufferlist payload;