Repository navigation
Resolves #1321 fixing service deadlocks - #1338
Conversation
|
jenkins, test this please |
42cff88 to
5ff1c1c
Compare
|
Not sure why the last tests timed out. Any clues @cket @hannes-ucsc ? |
|
Seems like this branch is slower. I will do some performance probing. |
|
Due to the parallel nature of the tests it is hard to determine which test timed out. We should change run_tests.sh to pipe output through Just by staring at the output, I can tell that CGCloudRestartTest was running while timeout occurred but that all other tests had passed. @cket remind me to explain my reasoning. It's possible that that tests simply hung. |
|
Okay, the tests passed this time, I'm squashing the commits then (assuming it passes), I'd like @cket or @hannes-ucsc to review and get this in. I want to work on testing of spark services next - @fnothaft what's happened with the docs pr? |
- Fixes deadlocks as described in #1321. - Refactors leader class to combine jobBatcher and leader functions into combined leader class, cleaning up state. - Puts statsAndLogging and serviceManager in their own files, to slim leader.py - Fixes some bugs in clusterScaler.py, notably that scheduling algorithm was not properly doing first fit decreasing binpacking - Fixes serialization bug for passing promised between jobs in multi-stage service clusters - Adds documentation describing deadlock issues for services. - Adds simple test for deadlock detection - Removes redundant copy of toilState object (we had two!) - Improves jobTest to include services in random dags.
9d9a288 to
d94c306
Compare
cket
left a comment
There was a problem hiding this comment.
My main point of confusion is why this is using average time and the number of service jobs to manage deadlocks instead of looking at the ratio of service jobs to total jobs. It seems to me that looking at the average historical time for all jobs is too broad to accurately detect service deadlocks, and could potentially result in over-provisioning of the cluster.
Also, some of these files are missing newlines at the end.
|
|
||
| # Parameters to limit service jobs, so preventing deadlock scheduling scenarios | ||
| self.maxPreemptableServiceJobs = sys.maxint | ||
| self.maxServiceJobs = sys.maxint |
There was a problem hiding this comment.
Using the ratio of services/total jobs would let you set a reasonable default here instead of maxint, which won't prevent any deadlocks.
There was a problem hiding this comment.
Correct, I did not enable this by default because I was worried about it making weird side effects. I prefer this conservative approach until we have tested it at scale.
| self.serviceJobsToBeIssued.append(jobNode) | ||
| self.issueQueingServiceJobs() | ||
|
|
||
| def issueQueingServiceJobs(self): |
There was a problem hiding this comment.
Wouldn't this make more sense in the service manager? It took me a while to find this code
| @staticmethod | ||
| def statsAndLoggingAggregator(jobStore, stop): | ||
| # Represents a job and its requirements as issued to the batch system | ||
| IssuedJob = namedtuple("IssuedJob", "jobStoreID memory cores disk preemptable") |
There was a problem hiding this comment.
This isn't used anywhere, I think it was removed in the job name PR. Maybe reintroduced in a merge error?
|
|
||
| :param toil.job.JobNode job: The memory, core and disk requirements of the completed job | ||
|
|
||
| :param IssuedJob job: The memory, core and disk requirements of the completed job |
There was a problem hiding this comment.
Merge error? The old type hint was correct but the comment was wrong. 'job' is now just a jobNode object not a tuple.
|
|
||
| # Make correction, if necessary (only do so if cluster is busy and average runtime is higher than historical | ||
| # average) | ||
| if runtimeCorrection != 1.0: |
There was a problem hiding this comment.
This would be unnecessary if we limited the ratio of services issued, right? It seems like there are a lot of scenarios where this would be triggered without being in a deadlock.
There was a problem hiding this comment.
This will be triggered a bunch, but I still think it's a better way to adjust our prior on how long we expect the cluster to run. Remember when we first start up the cluster it can take ages before it has a decent set of jobs to properly estimate the runtime of queued jobs. This heuristic will tend to increase the cluster size to tackle this case.
|
@cket providing the tests complete, are you okay with doing a merge? |
|
@benedictpaten yes, you answered my main question about the runtime based scaling. Once we have real autoscaling data we can start adjusting any scaling algorithms, if needed |
|
Good, agree about putting in better defaults for max services down the road. |
No description provided.