Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix convert integer CONCURRENT_REQUEST_PER_WORKER #1247

Merged
merged 1 commit into from Jul 2, 2021

Conversation

MichaelBitard
Copy link
Contributor

Proposed changes:
If you try to override the variable in the docker-compose environment, it fails with:
CONCURRENT_REQUEST_PER_WORKER=20

[2021-07-02 09:35:53 +0000] [10] [ERROR] Exception in worker process
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/gunicorn/arbiter.py", line 589, in spawn_worker
    worker.init_process()
  File "/usr/local/lib/python3.7/site-packages/uvicorn/workers.py", line 64, in init_process
    super(UvicornWorker, self).init_process()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 134, in init_process
    self.load_wsgi()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/workers/base.py", line 146, in load_wsgi
    self.wsgi = self.app.wsgi()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/base.py", line 67, in wsgi
    self.callable = self.load()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 58, in load
    return self.load_wsgiapp()
  File "/usr/local/lib/python3.7/site-packages/gunicorn/app/wsgiapp.py", line 48, in load_wsgiapp
    return util.import_app(self.app_uri)
  File "/usr/local/lib/python3.7/site-packages/gunicorn/util.py", line 359, in import_app
    mod = importlib.import_module(module)
  File "/usr/local/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/user/rest_api/application.py", line 8, in <module>
    from rest_api.controller.router import router as api_router
  File "/home/user/rest_api/controller/router.py", line 3, in <module>
    from rest_api.controller import file_upload, search, feedback
  File "/home/user/rest_api/controller/search.py", line 47, in <module>
    concurrency_limiter = RequestLimiter(CONCURRENT_REQUEST_PER_WORKER)
  File "/home/user/rest_api/controller/utils.py", line 9, in __init__
    self.semaphore = Semaphore(limit - 1)
TypeError: unsupported operand type(s) for -: 'str' and 'int'
[

It should be converted to int beforehand

Status (please check what you already did):

  • First draft (up for discussions & feedback)
  • Final code
  • Added tests
  • Updated documentation

@MichaelBitard
Copy link
Contributor Author

Related to #1228

Copy link
Contributor

@lalitpagaria lalitpagaria left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@lalitpagaria
Copy link
Contributor

@tholor can you please merge

@tholor tholor merged commit aaed223 into deepset-ai:master Jul 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants