| 2267 | } |
| 2268 | |
| 2269 | Status MasterSession::RunCallable(CallOptions* opts, |
| 2270 | const RunCallableRequest& req, |
| 2271 | RunCallableResponse* resp) { |
| 2272 | UpdateLastAccessTime(); |
| 2273 | ReffedClientGraph* callable; |
| 2274 | { |
| 2275 | mutex_lock l(mu_); |
| 2276 | if (closed_) { |
| 2277 | return errors::FailedPrecondition("Session is closed."); |
| 2278 | } |
| 2279 | int64 handle = req.handle(); |
| 2280 | if (handle >= next_callable_handle_) { |
| 2281 | return errors::InvalidArgument("No such callable handle: ", handle); |
| 2282 | } |
| 2283 | auto iter = callables_.find(req.handle()); |
| 2284 | if (iter == callables_.end()) { |
| 2285 | return errors::InvalidArgument( |
| 2286 | "Attempted to run callable after handle was released: ", handle); |
| 2287 | } |
| 2288 | callable = iter->second; |
| 2289 | callable->Ref(); |
| 2290 | ++num_running_; |
| 2291 | } |
| 2292 | core::ScopedUnref unref_callable(callable); |
| 2293 | return DoRunCallable(opts, callable, req, resp); |
| 2294 | } |
| 2295 | |
| 2296 | Status MasterSession::ReleaseCallable(const ReleaseCallableRequest& req, |
| 2297 | ReleaseCallableResponse* resp) { |
nothing calls this directly
no test coverage detected