@@ -167,6 +167,24 @@ RequestHandler::RequestHandler(const Request::ConstPtr& request, const ResponseF
167
167
, manager_(NULL )
168
168
, metrics_(metrics) {}
169
169
170
+ RequestHandler::~RequestHandler () {
171
+ if (Logger::log_level () >= CASS_LOG_TRACE) {
172
+ OStringStream ss;
173
+ for (RequestTryVec::const_iterator it = request_tries_.begin (), end = request_tries_.end ();
174
+ it != end; ++it) {
175
+ if (it != request_tries_.begin ()) ss << " , " ;
176
+ ss << " (" << it->address << " , " ;
177
+ if (it->error != CASS_OK) {
178
+ ss << cass_error_desc (it->error );
179
+ } else {
180
+ ss << it->latency ;
181
+ }
182
+ ss << " )" ;
183
+ }
184
+ LOG_TRACE (" Speculative execution attempts: [%s]" , ss.str ().c_str ());
185
+ }
186
+ }
187
+
170
188
void RequestHandler::set_prepared_metadata (const PreparedMetadata::Entry::Ptr& entry) {
171
189
wrapper_.set_prepared_metadata (entry);
172
190
}
@@ -269,6 +287,10 @@ void RequestHandler::set_response(const Host::Ptr& host, const Response::Ptr& re
269
287
metrics_->record_speculative_request (uv_hrtime () - start_time_ns_);
270
288
}
271
289
}
290
+
291
+ if (Logger::log_level () >= CASS_LOG_TRACE) {
292
+ request_tries_.push_back (RequestTry (host->address (), uv_hrtime () - start_time_ns_));
293
+ }
272
294
}
273
295
274
296
void RequestHandler::set_error (CassError code, const String& message) {
@@ -289,6 +311,9 @@ void RequestHandler::set_error(const Host::Ptr& host, CassError code, const Stri
289
311
set_error (code, message);
290
312
}
291
313
}
314
+ if (Logger::log_level () >= CASS_LOG_TRACE) {
315
+ request_tries_.push_back (RequestTry (host->address (), code));
316
+ }
292
317
}
293
318
294
319
void RequestHandler::set_error_with_error_response (const Host::Ptr& host,
@@ -297,6 +322,9 @@ void RequestHandler::set_error_with_error_response(const Host::Ptr& host,
297
322
stop_request ();
298
323
running_executions_--;
299
324
future_->set_error_with_response (host->address (), error, code, message);
325
+ if (Logger::log_level () >= CASS_LOG_TRACE) {
326
+ request_tries_.push_back (RequestTry (host->address (), code));
327
+ }
300
328
}
301
329
302
330
void RequestHandler::stop_timer () { timer_.stop (); }
0 commit comments