The initial plan was to follow 500 Lines or Less: A Continuous Integration System, but deviated a lot.
- Wrote a multiprocess socket server class using
os.fork
and thesocket
library. This enables initiating a server that can handle multiple connections, to be used as a server for the dispatcher and runner.
- Although I could have used the
socketserver
library, I wanted to code my own socket server class that usesos.fork
. - The first major problem I encountered was the clash between ending the loop and creating a new instance.
- While trying to solve that problem, I realized there were other problems too, like zombie processes and socket file descriptors not closing correctly.
- This was partially solved in commit #a97101b by using
os.wait
to make the parent process wait until interruptions, closing the listening socket in the child process, and separating the start and serve methods from the constructor. - Resources that helped: