More end to end test debugging
diff --git a/src/node/ext/completion_queue_async_worker.cc b/src/node/ext/completion_queue_async_worker.cc
index 5c0e27e..dbacdf0 100644
--- a/src/node/ext/completion_queue_async_worker.cc
+++ b/src/node/ext/completion_queue_async_worker.cc
@@ -35,6 +35,7 @@
#include <nan.h>
#include "grpc/grpc.h"
+#include "grpc/support/log.h"
#include "grpc/support/time.h"
#include "completion_queue_async_worker.h"
#include "call.h"
@@ -57,6 +58,7 @@
void CompletionQueueAsyncWorker::Execute() {
result = grpc_completion_queue_next(queue, gpr_inf_future);
+ gpr_log(GPR_DEBUG, "Handling response on call %p", result->call);
if (result->data.op_complete != GRPC_OP_OK) {
SetErrorMessage("The batch encountered an error");
}
@@ -77,14 +79,15 @@
void CompletionQueueAsyncWorker::HandleOKCallback() {
NanScope();
+ gpr_log(GPR_DEBUG, "Handling response on call %p", result->call);
NanCallback callback = GetTagCallback(result->tag);
Handle<Value> argv[] = {NanNull(), GetTagNodeValue(result->tag)};
+ callback.Call(2, argv);
+
DestroyTag(result->tag);
grpc_event_finish(result);
result = NULL;
-
- callback.Call(2, argv);
}
void CompletionQueueAsyncWorker::HandleErrorCallback() {
@@ -92,11 +95,11 @@
NanCallback callback = GetTagCallback(result->tag);
Handle<Value> argv[] = {NanError(ErrorMessage())};
+ callback.Call(1, argv);
+
DestroyTag(result->tag);
grpc_event_finish(result);
result = NULL;
-
- callback.Call(1, argv);
}
} // namespace node