cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results for 
Search instead for 
Did you mean: 

[ERROR] Worker (pid:11) was sent code 132 When deploying a Custom Model in serving

Junqueira
New Contributor II

Hi, I've been developing a custom model with mlflow.pyfunc.PythonModel. Among other libs, I use ANNOY. While trying to serve the model as an endpoint in "serving", After a few fixes my model worked fine as well the endpoin call.

Altough, I tried update it, no big deal, but i didn's start the serving point again, it keeps showing the error: 

[ERROR] Worker (pid:11) was sent code 132

It tries to change worker e nothing happens. Even if I backup the older model, that works, the same error. AFter many changes and testing, I notice that ine thing is different from the working one from the fails. 

Fails have : "Using worker: sync"

Working has "Using worker: gevent"

 

How to I specifiy to use "gevent" working when starting an serving.??

thank you

1 REPLY 1

WiliamRosa
Contributor

Great observation! The difference between Using worker: sync and Using worker: gevent typically refers to the worker class used by Gunicorn, the web server behind many MLflow model deployments (like in Databricks model serving or other MLflow-compatible environments).

The error:

[ERROR] Worker (pid:11) was sent code 132


...often indicates a crash during model loading or execution, and differences in worker type (sync vs gevent) can affect how threads and concurrency are handled — which matters a lot when you're using libraries like ANNOY, which might rely on file descriptors or multithreading.

- Solution: Force the model serving to use the gevent worker

MLflow doesn't let you directly set the Gunicorn worker type via the Python API (e.g., mlflow.models.serve) or Databricks model serving configuration.

However, if you're serving locally or managing the model server yourself (e.g., using MLflow + Docker), you can manually specify the worker type using Gunicorn flags.

Example (Manual MLflow Serve):
gunicorn -b 0.0.0.0:5000 -w 4 --worker-class gevent mlflow.pyfunc.scoring_server.wsgi:app

This way you can serve your MLflow model with gevent workers explicitly.

Wiliam Rosa
Data Engineer | Machine Learning Engineer
LinkedIn: linkedin.com/in/wiliamrosa

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now