On 09/14/12 12:37 PM, Cyril Feraudet wrote:
This is mine ;-) Try the last version on my branch.
This plugin work fine in a large environment (5300 server and more than 19000 
update by second in MySQL) but never tested on Solaris.

I think I found the issue.  If you look at:

https://github.com/feraudet/collectd/blob/cf/perfwatcher/src/write_mysql.c#L532-576

On line 536 the mutex is unlocked. And then, on line 576 it's unlocked again. On a sufficiently fast/multithreaded machine another thread can grab the lock in between those two lines, and then probably get hung up on I/O talking to the mysql server right afterward. Then the lock gets undone, and then another thread will lock it again and try to talk to Mysql on its own.

So the locks/unlocks get out of sync and there's no longer exclusive access to the database handle.

Since there's an unlock on line 572, the one on line 576 can probably be removed.

_______________________________________________
collectd mailing list
[email protected]
http://mailman.verplant.org/listinfo/collectd

Reply via email to