For those waiting for aolserver 4, it's getting close. For me, it's already there -- it's far more stable for me than 3.5.1 was. Memory leaking, if any, is low, but I restart daily to reinit my cacheing, so YMMV. I've had zero crashes since I moved CB to it full-time Friday and no suspicious errors in my log.
Here's what I had to do, if you're curious:
- download & compile nspostgres4 beta. I'm running oacs 3.2, so this was the only extra module I needed. (rl_returnz compiled with no changes.)
- add nsdb to my init.tcl modules list -- otherwise, it doesn't get loaded in 4
- specify -b ip:port in my startup; they broke it so it won't bind before switching to the non-root user otherwise, so port 80 gets permission denied
- patch pthread.c so "ns_mutex destroy" doesn't have the potential of crashing the server. (aolserver developers don't feel this patch is worth applying officially but if you ever want to destroy a mutex, you pretty much need it.)
--- pthread.c Sat May 3 19:04:52 2003 +++ pthread.c.old Sat May 3 19:03:10 2003 @@ -181,14 +181,9 @@ void NsLockFree(void *lock) { - int err = EBUSY; + int err; - /* spinwait until it's unlocked */ - while (err == EBUSY) { - err = pthread_mutex_destroy((pthread_mutex_t *) lock); - } - /* {0,EBUSY} is supposed to be the only valid return codes for _destroy, - but we'll check anyway */ + err = pthread_mutex_destroy((pthread_mutex_t *) lock); if (err != 0) { NsThreadFatal("NsLockFree", "pthread_mutex_destroy", err); }- patch tclvar.c so "nsv_incr" behaves the way it should: throw an error when the key doesn't exist. I have not yet submitted this patch.
--- tclvar.c Sat May 3 20:17:44 2003 +++ tclvar.c.old Sat May 3 19:53:02 2003 @@ -242,7 +242,7 @@ NsTclNsvIncrObjCmd(ClientData arg, Tcl_Interp *interp, int objc, Tcl_Obj **objv) { Array *arrayPtr; - int count, current, result; + int count, current, result, new; char *value; Tcl_HashEntry *hPtr; @@ -256,23 +256,21 @@ return TCL_ERROR; } arrayPtr = LockArray(arg, interp, objv[1], 1); - hPtr = Tcl_FindHashEntry(&arrayPtr->vars, Tcl_GetString(objv[2])); - if (hPtr != NULL) { + hPtr = Tcl_CreateHashEntry(&arrayPtr->vars, Tcl_GetString(objv[2]), &new); + if (new) { + current = 0; + result = TCL_OK; + } else { value = Tcl_GetHashValue(hPtr); result = Tcl_GetInt(interp, value, ¤t); - if (result == TCL_OK) { - Tcl_Obj *obj = Tcl_GetObjResult(interp); - current += count; - Tcl_SetIntObj(obj, current); - UpdateVar(hPtr, obj); - } } - UnlockArray(arrayPtr); - - if (hPtr == NULL) { - Tcl_AppendResult(interp, "no such key: ", Tcl_GetString(objv[2]), NULL); - result = TCL_ERROR; + if (result == TCL_OK) { + Tcl_Obj *obj = Tcl_GetObjResult(interp); + current += count; + Tcl_SetIntObj(obj, current); + UpdateVar(hPtr, obj); } + UnlockArray(arrayPtr); return result; } - patch tclvar.c so "nsv_incr" behaves the way it should: throw an error when the key doesn't exist. I have not yet submitted this patch.
Request notifications