I added a test of correct ns_cond behavior here:
  
https://bitbucket.org/apiskors/naviserver/commits/2ed58b6a9c0567fe7cbee1080e30274b2aba64be

Which adds these two new files:
  tests/ns_cond.test
  tests/testserver/modules/ns_cond.tcl 

To run the test on Linux, just do:
  make test TCLTESTARGS='-file ns_cond.test' 

As you can see from the log output below, ns_cond works fine on
AOLserver, but not on Naviserver.  On Naviserver, once the worker
thread calls "ns_cond wait" the first time, it just never wakes up.
It's as if the cond signal just never makes it here.  This was run on
Linux; behavior on Windows is the same.


# BUG on Naviserver, the worker never wakes up:
ns_cond.test
[18/Oct/2014:02:34:50][23566.2aadb6049700][-command-] Notice: tst_cond_master: 
New thread '' started for running tst_cond_worker.
[18/Oct/2014:02:34:50][23566.2aae0c401700][-thread:2aae0c401700-] Notice: 
tst_cond_worker: 2 work items:  0 1
[18/Oct/2014:02:34:54][23566.2aadb6049700][-command-] Notice: tst_cond_master: 
2 work items done:  0 1
[18/Oct/2014:02:34:54][23566.2aadb6049700][-command-] Notice: tst_cond_master: 
3 work items NOT done:  2 3 4
==== ns_cond-1.1 Master uses ns_cond to wake up a worker thread. FAILED

# Correct behavior on AOLserver 4.0.10:
[18/Oct/2014:02:32:38][16918.18446744071699884032][-conn:outpost-dev::0] 
Notice: tst_cond_master: New thread '' started for running tst_cond_worker.
[18/Oct/2014:02:32:38][16918.18446744071622727680][-thread-2086823936-] Notice: 
tst_cond_worker: 2 work items:  0 1
[18/Oct/2014:02:32:39][16918.18446744071622727680][-thread-2086823936-] Notice: 
tst_cond_worker: Event 'eid0x7fb97ca16600' - got it.
[18/Oct/2014:02:32:39][16918.18446744071622727680][-thread-2086823936-] Notice: 
tst_cond_worker: 1 work items:  2
[18/Oct/2014:02:32:40][16918.18446744071622727680][-thread-2086823936-] Notice: 
tst_cond_worker: Event 'eid0x7fb97ca16600' - got it.
[18/Oct/2014:02:32:40][16918.18446744071622727680][-thread-2086823936-] Notice: 
tst_cond_worker: 1 work items:  3
[18/Oct/2014:02:32:41][16918.18446744071622727680][-thread-2086823936-] Notice: 
tst_cond_worker: Event 'eid0x7fb97ca16600' - got it.
[18/Oct/2014:02:32:41][16918.18446744071622727680][-thread-2086823936-] Notice: 
tst_cond_worker: 1 work items:  4
[18/Oct/2014:02:32:42][16918.18446744071699884032][-conn:outpost-dev::0] 
Notice: tst_cond_master: 5 work items done:  0 1 2 3 4
[18/Oct/2014:02:32:42][16918.18446744071699884032][-conn:outpost-dev::0] 
Notice: tst_cond_master: 0 work items NOT done:  
[18/Oct/2014:02:32:42][16918.18446744071622727680][-thread-2086823936-] Notice: 
tst_cond_worker: Event 'eid0x7fb97ca16600' - got it.
[18/Oct/2014:02:32:42][16918.18446744071622727680][-thread-2086823936-] Notice: 
tst_cond_worker: 0 work items:  
[18/Oct/2014:02:32:42][16918.18446744071622727680][-thread-2086823936-] Notice: 
tst_cond_worker: No more work for me today.

-- 
Andrew Piskorski <a...@piskorski.com>

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel

Reply via email to