Tip
When monkey patching, it is recommended to do so as early as possible in the lifetime of the process. If possible, monkey patching should be the first lines executed. Monkey patching later, especially if native threads have been created, atexit
or signal handlers have been installed, or sockets have been created, may lead to unpredictable results including unexpected LoopExit
errors.