workernode should get their tasks from the heartbeat

Issue #62 new
Antoine Pietri created an issue

When using the master/worker system on a network we don't control, an important number of problems arise, especially when some of the workers are behind a NAT.

Currently, the system works this way:

  • The workernode sends a heartbeat to the masternode
  • The masternode registers the workernode and its hostname if he does not know it yet
  • When a task has to be dispatched, the masternode does an RPC request to the worker to send the task
  • When the task is complete, the workernode does an RPC request to the master to send the result back

This requires all the workers to be accessible from the masternode. This prevents us from running workers behind a NAT.

A better way to do that would be to send the tasks as a response to the heartbeat request. When a workernode sends a heartbeat, we check if it has any new tasks attributed, and we reply to the heartbeat request with these new tasks.

This will require a lot of changes in the code. What do you think of this design change?

Comments (0)

  1. Log in to comment