5

I just learned the hard way not to recklessly daemonize stuff; I ran into a case where my Python script crashes Python itself.

The issue was that one of the query that “requests” package makes for OS was not fork safe, thus causing a segfault. Since Python drops dead as soon as it receives SIGSEGV, all I had was macOS crash log (which is oftentimes hard to decipher). I spent like good one hour before I found “faulthandler” package which enabled me to log the stack trace to stderr and see what the f*<k was going on.

I mean, I’ve seen quite a lot of occurrences of thread safety issues, but now it’s fork safety!?

Maybe I should be sticking to Docker or something unless the situation *really* requires me to daemonize something lol

Comments
  • 0
    Or use aiohttp for simultaneous requests or concurrent.futures
  • 2
    Maybe don't use garbage languages like Python
Add Comment