saltstack/salt — pull request #2046 by thekuffs (2012-09-20 01:55:03+00:00)
Title: Windows multiprocessing support and Esky bugfixes

This pull request solves the longstanding issue with multiprocessing support on Windows. I've also added a few Esky bugfixes that makes ```saltutil.update``` work correctly now.

This multiprocessing issue stems from the way that forking works in Unix vs. Windows. In Unix, forked processes have a copy of the memory pages from the parent process, so all salt modules and functions are able to be passed with references into the child. In Windows, the multiprocessing library has to pass pickled data to the child process via a loopback socket. Since functions (loaded from modules) are not pickleable, the multiprocessing failed on Windows.

I've made classmethods out of the two minion dispatch methods. These classmethods will be passed a copy of the parent instance in the case of Unix, and on Windows a new minion instance will be generated after the fork. This makes job dispatch slower on Windows, and we should consider ways to streamline it and perhaps adopt a shared path for both platform.

I've also added some logging functions here and there, to aid in the debugging I did.

I cleaned up ```saltutil.update``` from #2015 and #2017, it will now do seamless upgrades on both Windows and Linux.

I've tested this branch on both Windows Server 2008 and CentOS 6.3.