a2htray opened a new issue, #140:
URL: https://github.com/apache/rocketmq-client-python/issues/140

   My application is deveplped with Django which provides a Web API service and 
runs over UWSGI. The real code is as follows:
   
   ```python
   mq_locals = {}
   
   
   def get_producer() -> Producer:
       if 'producer' not in mq_locals:
           producer = Producer('XXX')
           producer.set_namesrv_addr(settings.ODMS_CONFIG['name_server'])  # 
pylint: disable=E1101
           producer.start()
   
           mq_locals['producer'] = producer
   
       return mq_locals['producer']
   ```
   
   But the application raises a `rocketmq.exceptions.ProducerStartFailed: 
boost::thread_resource_error: Resource temporarily unavailable` when the 
`get_producer` method is called. 
   
   The version of `rocketmq-client-python` and `rocketmq` are **2.0.0** and 
**0.4.4** respectively. And the OS is Ubuntu. The Detailed log is as follows.
   
   ```bash
   Traceback (most recent call last):
     File 
"/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", 
line 34, in inner
       response = get_response(request)
     File 
"/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 
115, in _get_response
       response = self.process_exception_by_middleware(e, request)
     File 
"/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 
113, in _get_response
       response = wrapped_callback(request, *callback_args, **callback_kwargs)
     File 
"/usr/local/lib/python3.7/site-packages/django/views/decorators/http.py", line 
40, in inner
       return func(request, *args, **kwargs)
     File "/dc_utils3/dc_account_md/decorators.py", line 29, in _wrapped_view
       return view_func(request, *args, **kwargs)
     File "./odms/views/submission_approve.py", line 64, in submission_approve
       send_approve_message(submission.archive_id, mq_srv.APPROVE_STATUS_YES, 
comment)
     File "./odms/views/submission_approve.py", line 74, in send_approve_message
       mq_srv.send_approve_message(archive_id, approve_status, comment)
     File "./odms/services/mq.py", line 58, in send_approve_message
       echo_producer = get_producer()
     File "./odms/services/mq.py", line 30, in get_producer
       producer.start()
     File "/usr/local/lib/python3.7/site-packages/rocketmq/client.py", line 
329, in start
       ffi_check(dll.StartProducer(self._handle))
     File "/usr/local/lib/python3.7/site-packages/rocketmq/exceptions.py", line 
27, in ffi_check
       raise exc_cls(msg)
   rocketmq.exceptions.ProducerStartFailed: boost::thread_resource_error: 
Resource temporarily unavailable
   ```
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to