index 13a0cd0c2eec7b148352fe230782ff542f4f60a8..279bf3604b4c20d0b7cfefe492cd6397f98a047c 100644 (file)
}
}
- LOG2("NameServer Response: instanceName: %s, name: %s,",
- (String)msg->instanceName, (String)msg->name)
/* set the request status */
if (status < 0) {
- LOG1(" Value not found, status: %d\n", status)
+ LOG3("NameServer Response: instance: %s, name: %s, value not "
+ "found, status: %d\n", (String)msg->instanceName,
+ (String)msg->name, status);
msg->requestStatus = 0;
}
else {
+ LOG3("NameServer Response: instance: %s, name: %s, value: 0x%x\n",
+ (String)msg->instanceName, (String)msg->name, msg->value);
msg->requestStatus = 1;
- LOG1(" Value: 0x%x\n", msg->value)
}
/* specify message as a response */
}
else {
LOG1("listener_cb: recvfrom socket: fd: %d\n", sock)
- LOG2("\tReceived ns msg: nbytes: %d, from addr: %d, ",
- nbytes, fromAddr.addr)
- LOG1("from vproc: %d\n", fromAddr.vproc_id)
+ LOG3("\tReceived ns msg: nbytes: %d, from addr: %d, "
+ "from vproc: %d\n", nbytes, fromAddr.addr,
+ fromAddr.vproc_id);
NameServerRemote_processMessage(&msg, procId);
}
}
/* destroy the mutex */
pthread_mutex_destroy(&obj->gate);
+ /* remove from objList */
+ CIRCLEQ_REMOVE(&NameServer_module->objList, obj, elem);
+
/* finally, free the instance object */
free(obj);
strncpy((char *)nsMsg.instanceName, obj->name, strlen(obj->name) + 1);
strncpy((char *)nsMsg.name, name, strlen(name) + 1);
- LOG2("NameServer_getRemote: Requesting from procId %d, %s:",
- procId, (String)nsMsg.instanceName)
- LOG1("%s...\n", (String)nsMsg.name)
+ LOG3("NameServer_getRemote: requesting from procId %d, %s: %s\n",
+ procId, (String)nsMsg.instanceName, (String)nsMsg.name);
err = send(sock, &nsMsg, sizeof(NameServerRemote_Msg), 0);
if (err < 0) {
/* set the contents of value */
if (*len <= sizeof (Bits32)) {
*(UInt32 *)value = (UInt32)replyMsg->value;
- LOG2("NameServer_getRemote: Reply from: %d, %s:",
- procId, (String)replyMsg->instanceName)
- LOG2("%s, value: 0x%x...\n",
- (String)replyMsg->name, *(UInt32 *)value)
+ LOG4("NameServer_getRemote: Reply from: %d, %s: "
+ "name: %s, value: 0x%x\n", procId,
+ (String)replyMsg->instanceName,
+ (String)replyMsg->name, *(UInt32 *)value);
}
else {
memcpy(value, replyMsg->valueBuf, *len);
/* procId already validated in API layer */
clId = procId - MultiProc_getBaseIdOfCluster();
+ LOG2("NameServer_attach: --> procId=%d, refCount=%d\n",
+ procId, NameServer_module->comm[clId].refCount)
+
/* must reference count because we have multiple clients */
if (NameServer_module->comm[clId].refCount > 0) {
NameServer_module->comm[clId].refCount++;
}
}
+ LOG2("NameServer_attach: <-- refCount=%d, status=%d\n",
+ NameServer_module->comm[clId].refCount, status)
+
return (status);
}
/* procId already validated in API layer */
clId = procId - MultiProc_getBaseIdOfCluster();
+ LOG2("NameServer_detach: --> procId=%d, refCount=%d\n",
+ procId, NameServer_module->comm[clId].refCount)
+
+ /* decrement reference count regardless of outcome below */
if (--NameServer_module->comm[clId].refCount > 0) {
goto done;
}
read(NameServer_module->waitFd, &event, sizeof(event));
/* close the sending socket */
- LOG1("NameServer_destroy: closing socket: %d\n", sendSock)
+ LOG1("NameServer_detach: closing socket: %d\n", sendSock)
close(sendSock);
/* close the receiving socket */
- LOG1("NameServer_destroy: closing socket: %d\n", recvSock)
+ LOG1("NameServer_detach: closing socket: %d\n", recvSock)
close(recvSock);
- /* decrement the reference count */
- NameServer_module->comm[clId].refCount--;
-
done:
+ LOG2("NameServer_detach: <-- refCount=%d, status=%d\n",
+ NameServer_module->comm[clId].refCount, status)
return (status);
}