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

Bottle missing gevent monkey patch #49

Closed
doismellburning opened this issue Apr 16, 2014 · 7 comments
Closed

Bottle missing gevent monkey patch #49

doismellburning opened this issue Apr 16, 2014 · 7 comments
Assignees
Labels
Milestone

Comments

@doismellburning
Copy link

Currently, attempting to run pypiserver with --server gevent fails due to lack of a monkey patch call:

$ pip freeze | grep pypiserver
pypiserver==1.1.6
$ pip freeze | grep gevent
gevent==1.0
$ pypi-server --server gevent -P htpasswd goat/
This is pypiserver 1.1.6 serving '/home/vagrant/goat' on http://0.0.0.0:8080

Bottle v0.11.6 server starting up (using GeventServer())...
Listening on http://0.0.0.0:8080/
Hit Ctrl-C to quit.

Traceback (most recent call last):
  File "/home/vagrant/.env/bin/pypi-server", line 11, in <module>
    sys.exit(main())
  File "/home/vagrant/.env/local/lib/python2.7/site-packages/pypiserver/core.py", line 328, in main
    run(app=a, host=host, port=port, server=server)
  File "/home/vagrant/.env/local/lib/python2.7/site-packages/pypiserver/bottle.py", line 2703, in run
    server.run(app)
  File "/home/vagrant/.env/local/lib/python2.7/site-packages/pypiserver/bottle.py", line 2499, in run
    raise RuntimeError(msg)
RuntimeError: Bottle requires gevent.monkey.patch_all() (before import)
@schmir
Copy link
Contributor

schmir commented Apr 16, 2014

good catch. Thanks for reporting!

@ankostis ankostis added this to the M1.1.8 milestone Mar 9, 2015
ankostis added a commit to ankostis/pypiserver that referenced this issue Mar 15, 2015
@ankostis
Copy link
Member

@doismellburning Would you mind checking if my branch fixed it?

ankostis added a commit to ankostis/pypiserver that referenced this issue Mar 15, 2015
@doismellburning
Copy link
Author

(.env)[2015-03-15T12:08:43+0000 ~/pypiserver] (detached from fcf6f4c) $ pip freeze
You are using pip version 6.0.6, however version 6.0.8 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
gevent==1.0.1
greenlet==0.4.5
passlib==1.6.2
-e git+git@github.com:pypiserver/pypiserver.git@fcf6f4c6153fe50d0b956e668c02d1fe6ea2af72#egg=pypiserver-ankostis_gevent
(.env)[2015-03-15T12:08:41+0000 ~/pypiserver] (detached from fcf6f4c) $ ./pypi-server --server gevent -P htpasswd .
Bottle v0.11.6 server starting up (using GeventServer())...
Listening on http://0.0.0.0:8080/
Hit Ctrl-C to quit.

Traceback (most recent call last):
  File "./pypi-server", line 5, in <module>
    main()
  File "/home/vagrant/pypiserver/pypiserver/core.py", line 454, in main
    run_bottle_server(app=a, host=host, port=port, server=server, roots=roots)
  File "/home/vagrant/pypiserver/pypiserver/core.py", line 312, in run_bottle_server
    bottle.run(app=app, host=host, port=port, server=server)
  File "/home/vagrant/pypiserver/pypiserver/bottle.py", line 2703, in run
    server.run(app)
  File "/home/vagrant/pypiserver/pypiserver/bottle.py", line 2499, in run
    raise RuntimeError(msg)
RuntimeError: Bottle requires gevent.monkey.patch_all() (before import)
Exception KeyError: KeyError(4524746704,) in <module 'threading' from '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.pyc'> ignored

Alas no - did you experience success yourself?

@ankostis
Copy link
Member

Me neither.

ankostis added a commit to ankostis/pypiserver that referenced this issue Mar 15, 2015
@ankostis
Copy link
Member

I think i nailed it. It was invoking app() before monkey-patch.
@doismellburning can you please try with latest commit?

Test-case pending.

@ankostis ankostis self-assigned this Mar 15, 2015
@ankostis
Copy link
Member

Tested on linux (gevent under Windows is still experintal) and it seems to work.

@ankostis ankostis reopened this Jul 29, 2015
ankostis added a commit to ankostis/pypiserver that referenced this issue Jul 29, 2015
+ gevent: Add TC on main.
+ ci: Update travis as container-based.
ankostis added a commit to ankostis/pypiserver that referenced this issue Jul 29, 2015
+ gevent: Add TC on main.
+ ci: Update travis as container-based.
@ankostis ankostis modified the milestones: M1.1.9, M1.1.8 Sep 15, 2015
@ankostis
Copy link
Member

Postponed.

Better restructure startup-sequence and update testing fictures. Them this will be trivial to fix.

ankostis added a commit to ankostis/pypiserver that referenced this issue Sep 15, 2015
ankostis added a commit to ankostis/pypiserver that referenced this issue Sep 15, 2015
ankostis added a commit to ankostis/pypiserver that referenced this issue Sep 17, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants