January 2020
Intermediate to advanced
640 pages
16h 56m
English
Once the worker receives a new job assignment from the master, it calls the coordinator's constructor and then invokes its RunJob method, which blocks until the job either completes or an error occurs:
func (c *workerJobCoordinator) RunJob() error { // ...}Let's break down the RunJob implementation into smaller chunks and go through each one:
execFactory := newWorkerExecutorFactory(c.cfg.serializer, c.barrier)executor, err := c.cfg.jobRunner.StartJob(c.cfg.jobDetails, execFactory)if err != nil { c.cancelJobCtx() return xerrors.Errorf("unable to start job on worker: %w", err)}graph := executor.Graph()graph.RegisterRelayer(bspgraph.RelayerFunc(c.relayNonLocalMessage))The very first thing that RunJob does is to create a ...