Is this also true for all the other ns_server commands like [ns_server connections] or [ns_server active] ?Because we are using these extensively for monitoring and performance analysis. It seems the only time we've had crashes due to use of [ns_server all] is when there were lots of waiting threads (in the backlog) in a heavy load situation. I agree that "ns_server all" may not be very stable but it'll be useful to know if all the there ns_server parameters may not be stable either.
It appears "active", "all", and "queued" are all unsafe. "Connections" is safe in that it shouldn't crash the server but it's not necessary correct in that it does a dirty read. Check the code in nsd/queue.c for details, in particular the AppendConn functions which has the following comments:
/*
* An annoying race condition can be lethal here.
*/
if ( connPtr != NULL ) {
* An annoying race condition can be lethal here.
*/
if ( connPtr != NULL ) {
...
/*
* Carefully copy the bytes to avoid chasing a pointer
* which may be changing in the connection thread. This
* is not entirely safe but acceptible for a seldom-used
* admin command.
*/
* Carefully copy the bytes to avoid chasing a pointer
* which may be changing in the connection thread. This
* is not entirely safe but acceptible for a seldom-used
* admin command.
*/
The problem is either the connPtr or some of the data buried in the conn can be changing in the running connection thread. I wouldn't suggest this be fixed because it could complicate the code and introduce a performance problem.
Perhaps you could describe what logging you're trying to do and a special module could be built to do the right thing safely with an acceptable performance penalty (if any).
-Jim
-- AOLserver - http://www.aolserver.com/ To Remove yourself from this list: http://www.aolserver.com/listserv.html List information and options: http://listserv.aol.com/
