conveyal / otpa-cluster

Cluster backend for otpa many-to-many queries.
0 stars 1 forks source link

Error kernel sampleset, pointset and graph caching #32

Closed mattwigway closed 9 years ago

mattwigway commented 9 years ago

There's not really a way to set up the WorkerManager so it has no internal state, because it has to know what it has sent to SPTWorkers, and on a restart its mailboxes still contain some data. Additionally, it will have lost its references to its router and sptworkers.

Thus, we need to move all dangerous operations out of WorkerManager. This includes getting sample sets. We'll still hang on to a reference to the graph in WorkerManager, but we'll not pass it directly to the SPTWorkers; instead, they'll request the graph as requests come in, and block until they get it. Since the graph building is single threaded, we'll still only build it once. We'll do the same with the sample set caching.

mattwigway commented 9 years ago

Thus if S3 goes down, the sample set cache will be restarted and the sptworker will be restarted, but sptworkers have no state so this is fine.

mattwigway commented 9 years ago

Done.