Author: lfrancke@gbif.org
Created: 2012-10-22 14:30:44.855
Updated: 2012-10-22 14:30:44.855
{quote}2.5) scheduleCrawl appears to have race conditions should 2 coordinators be running - a problem?{quote}
[~trobertson@gbif.org] Could you elaborate?
Author: lfrancke@gbif.org
Created: 2012-10-22 14:39:22.498
Updated: 2012-10-22 14:39:22.498
{quote}1.1) Apparent misuse of IllegalArgumentException
"scheduled already" is not an illegal argument really - suggest simply swallow the request, or introduce an InegibleToCrawlException.{quote}
Any opinion if this exception should be checked or unchecked?
Author: lfrancke@gbif.org
Comment: About that exception: I partly agree. Most of the exceptions I throw really are illegal arguments (doesn't exist, no endpoints etc.) but already scheduled is a different thing so I'll add an exception for that. We also have the case where a dataset is not synchronized (no metadata sync ever ran). I'm treating that as an illegal argument as well right now because I think we should only allow things to be passed in that are actually ready to be crawled.
Created: 2012-10-22 14:42:38.595
Updated: 2012-10-22 14:42:38.595
Author: trobertson@gbif.org
Created: 2012-10-24 09:44:18.431
Updated: 2012-10-24 09:45:23.063
2.5) Race condition:
- checkDataset() does a checkExists for the node in ZK
- should it not be running, later on the coordinator will call curator.create().creatingParentsIfNeeded().forPath(...
Assuming checkExists() does not actually create the node (the curator JDocs don't explain this) and simply check to see if it exists already, 2 running coordinators might check the existence of the node, see it doesn't exist and then later on, both could attempt to create it. I am not sure if this is valid or not, but something just to verify please.
1.1) I would say checked. Justification as generally, runtimes are non recoverable indicating things like server down, some illegal runtime state has occurred, or some bug, but in this instance you would want the developer to guard against it, and actually decide if they want to swallow, or retry later etc.
Author: lfrancke@gbif.org
Comment: Good catch about that race condition. It'll throw an exception when that happens. It isn't a beautiful exception but the special case handling doesn't warrant any better I think. I'll add a comment in the code.
Created: 2012-10-24 14:28:34.748
Updated: 2012-10-24 14:28:34.748
Author: lfrancke@gbif.org
Comment: I disagree on the unchecked/checked thing though. This is nothing the coder can do anything about. The uuid is ultimately provided by the user so it is very recoverable. If you don't feel strongly about it I'd leave it unchecked for now.
Created: 2012-10-24 14:32:22.793
Updated: 2012-10-24 14:32:22.793