Getting broken pipe when passing mysql connection to a python thread
问题 I'm trying to pass a mysql connection to a thread in python. If i do the initialization of the mysql inside the worker class, there is no error. However, it might be costly for the connection so I tried just passing the mysql connection from the caller function (see code below). But this keeps throwing this error: (2006, "MySQL server has gone away (BrokenPipeError(32, 'Broken pipe')) Any idea why? I think its because the way we pass the mysql connection def worker(db): """ Distributes the