Hello,
I have not tried the module yet - I've only skimmed through the code, and didn't see any locking of tables. It looks to me like if two nodes are created exactly at the same, a race condition could occur, in which both uniqueness checks pass first, and then both nodes are created. Is this true? We can try to emulate this by setting a breakpoint at just the right (*wrong) spot and selectively running the code.
Thanks,
Al
Comments
Comment #1
captainack commentedOkay, so I tried the breakpoint method above, but apparently for some reason in my environment, no other threads will spawn while I'm at a breakpoint. I'll save that one for another day and time :-/.
However, I have verified the bug by adding a
sleep(30);
just before the line:
if ($errmsg && !empty($errmsg) && is_array($errfld) && count($errfld) > 0) {
and submitting two duplicate nodes from two browser windows within seconds.
As I suspected, both nodes were created.
-Al Khaef
Comment #2
arithmetric commentedI don't think this is a significant problem. This module does not guarantee that duplicate content is in all cases prevented. Nodes can be created programmatically that bypass the validation process. Also, as you showed, if a node submission is delayed and another user submits matching content, both submissions may be allowed.
The goal of this module is to provide user notification and restrictions when duplicate content is found.