Commit 75936b39 authored by Leigh B. Stoller's avatar Leigh B. Stoller
Browse files

A possible hack/fix to the concurrency problem. I have not learned

anything conclusive, other than fork confuses mysqld, and our attempt
to unconfuse it by closing/opening the DB connection in the child,
confuses it even more! The parent connection is shutdown and then
restarted as well. In node_reboot, this could happen 10 times in rapid
succession as we fork as child for each node, and that appears to
strain the server even more (with 20 rapid connects).

So, I added a select(0.3) in TBdbfork() (in the child) to see if that
slows things down enough. In my tests, the length of time between the
parent and child operations makes a real difference. With a delay in
the child, the parent connection is not closed/restarted.

The astute reader will realize that I have no actual clue; just
grasping at, uh, threads.
parent 1d198a6c
......@@ -199,6 +199,7 @@ TBDBConnect();
sub TBdbfork()
{
select(undef, undef, undef, 0.3);
undef($DB);
TBDBConnect();
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment