I would like to proposes the follows for scheduler connection with server:
- Change the direction of connection initiation: Currently the server connects to the scheduler. However, this means the scheduler has to listen on a port and accept connections. On the other hand the server already does that very well, so we can simply reverse the direction of connection such that scheduler acts as a client (just like moms or IFL clients) and connects to the server after proper authentication.
- Make the scheduler connections persistent. There is no need to disconnect the connection between the server and scheduler just to indicate the end of a cycle, for which a message can be sent. That is less expensive than setting up and tearing down TCP connections. Besides, keeping a connection allows the scheduler to remain connected to all the servers irrespective of which server wanted to start the scheduling.
here is design page.
here is PR link.
So please review design and provide your feedback.