#342: Prevent duplicate tests from being scheduled ----------------------+----------------------------------------------------- Reporter: tflink | Owner: Type: defect | Status: new Priority: major | Milestone: 0.5.0 Component: watchers | Keywords: ----------------------+----------------------------------------------------- We currently have an issue where tests are being scheduled more than once.
This creates extra noise for maintainers and is a waste of resources - it should be fixed.
#342: Prevent duplicate tests from being scheduled ----------------------+----------------------------------------------------- Reporter: tflink | Owner: Type: defect | Status: new Priority: major | Milestone: 0.5.0 Component: watchers | Resolution: Keywords: | ----------------------+----------------------------------------------------- Comment (by tflink):
I'm not taking credit for the fix but I did create a reviewboard request for a proposed fix that uses lockfiles to determine whether or not another instance of the watcher is currently running.
https://fedorahosted.org/reviewboard/r/152/
I'll be reviewing the code and applying it to a test instance later today.
#342: Prevent duplicate tests from being scheduled ----------------------+----------------------------------------------------- Reporter: tflink | Owner: Type: defect | Status: new Priority: major | Milestone: 0.5.0 Component: watchers | Resolution: Keywords: | ----------------------+----------------------------------------------------- Comment (by jlaska):
I like this solution, but I'm curious why an extra lock file would be needed. While I'm not tremendously familiar with locking, is it better/worse/different when using the existing cachefile descriptor and the fcntl.lockf() function (with appropriate ops LOCK_EX|LOCK_NB, LOCK_UN)?
As a tangent (and shouldn't affect this patch) ... how do we determine whether to create a new autoqa library, versus add content into existing library (e.g. autoqa.utils)?
#342: Prevent duplicate tests from being scheduled ----------------------+----------------------------------------------------- Reporter: tflink | Owner: Type: defect | Status: new Priority: major | Milestone: 0.5.0 Component: watchers | Resolution: Keywords: | ----------------------+----------------------------------------------------- Comment (by jskladan):
Replying to [comment:2 jlaska]:
I like this solution, but I'm curious why an extra lock file would be
needed.
Well, it's not needed. As I said to Kamil, this is "just an implementation" of locking. Basically to determine whether the problem really is in the concurrent runs.
I personaly like lock file a bit more, because you can easily see whether the lock is active or not, and also which process has the lock (just by looking at/into the lockfile). But I'm not against using different approach, if you think it's more suitable.
The only thing I don't like about lockf/flock is lack of examples in the python documentation. And that's probably _the_ reason why I used lockfile - it was faster for me to grasp/implement.
#342: Prevent duplicate tests from being scheduled ----------------------+----------------------------------------------------- Reporter: tflink | Owner: Type: defect | Status: new Priority: major | Milestone: 0.5.0 Component: watchers | Resolution: Keywords: | ----------------------+----------------------------------------------------- Comment (by kparal):
Reviewed.
#342: Prevent duplicate tests from being scheduled ----------------------+----------------------------------------------------- Reporter: tflink | Owner: Type: defect | Status: new Priority: major | Milestone: 0.5.0 Component: watchers | Resolution: Keywords: | ----------------------+----------------------------------------------------- Comment (by jskladan):
As suggested by jlaska on IRC, I investigated the fcntl.flock() and changed the mechanism to use it. Code in reviewboard should be updated by now (thanks tflink).
#342: Prevent duplicate tests from being scheduled ----------------------+----------------------------------------------------- Reporter: tflink | Owner: Type: defect | Status: new Priority: major | Milestone: 0.5.0 Component: watchers | Resolution: Keywords: | ----------------------+----------------------------------------------------- Comment (by tflink):
Reviewed. Overall, it looks good to me.
#342: Prevent duplicate tests from being scheduled ----------------------+----------------------------------------------------- Reporter: tflink | Owner: Type: defect | Status: new Priority: major | Milestone: 0.5.0 Component: watchers | Resolution: Keywords: | ----------------------+----------------------------------------------------- Comment (by jskladan):
Replying to [comment:6 tflink]:
Reviewed. Overall, it looks good to me.
Thanks, updated version sent to your email.
#342: Prevent duplicate tests from being scheduled ----------------------+----------------------------------------------------- Reporter: tflink | Owner: Type: defect | Status: closed Priority: major | Milestone: 0.5.0 Component: watchers | Resolution: fixed Keywords: | ----------------------+----------------------------------------------------- Changes (by jskladan):
* status: new => closed * resolution: => fixed
#342: Prevent duplicate tests from being scheduled ----------------------+----------------------------------------------------- Reporter: tflink | Owner: Type: defect | Status: closed Priority: major | Milestone: 0.5.0 Component: watchers | Resolution: fixed Keywords: | ----------------------+----------------------------------------------------- Comment (by kparal):
The fix was in commit 6ce776f95bdaa186bb812f27b54fdf29873ebf1b .
autoqa-devel@lists.fedorahosted.org