Skip to content
New issue

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

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

Already on GitHub? # to your account

Check to see if Eve works under PyPy #20

Open
AGSPhoenix opened this issue Jan 18, 2019 · 2 comments
Open

Check to see if Eve works under PyPy #20

AGSPhoenix opened this issue Jan 18, 2019 · 2 comments

Comments

@AGSPhoenix
Copy link
Collaborator

mysqlclient might need to be replaced with PyMySQL

@AGSPhoenix
Copy link
Collaborator Author

import_patched doesn't seem to work for pymysql with a db_pool. The first query to the DB just returns this traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Phoenix\Downloads\pypy3.6-v7.1.1-win32\lib-python\3\contextlib.py", line 82, in __enter__
    return next(self.gen)
  File "C:\Users\Phoenix\Documents\eve\pypy-test\site-packages\eventlet\db_pool.py", line 245, in item
    conn = self.get()
  File "C:\Users\Phoenix\Documents\eve\pypy-test\site-packages\eventlet\db_pool.py", line 176, in get
    conn = super(BaseConnectionPool, self).get()
  File "C:\Users\Phoenix\Documents\eve\pypy-test\site-packages\eventlet\pools.py", line 88, in get
    created = self.create()
  File "C:\Users\Phoenix\Documents\eve\pypy-test\site-packages\eventlet\db_pool.py", line 276, in create
    self._db_module, self.connect_timeout, *self._args, **self._kwargs)
  File "C:\Users\Phoenix\Documents\eve\pypy-test\site-packages\eventlet\db_pool.py", line 283, in connect
    conn = tpool.execute(db_module.connect, *args, **kw)
  File "C:\Users\Phoenix\Documents\eve\pypy-test\site-packages\eventlet\tpool.py", line 125, in execute
    six.reraise(c, e, tb)
  File "C:\Users\Phoenix\Documents\eve\pypy-test\site-packages\eventlet\support\six.py", line 689, in reraise
    raise value
  File "C:\Users\Phoenix\Documents\eve\pypy-test\site-packages\eventlet\tpool.py", line 83, in tworker
    rv = meth(*args, **kwargs)
  File "C:\Users\Phoenix\Documents\eve\pypy-test\site-packages\pymysql\__init__.py", line 93, in Connect
    from .connections import Connection
SystemError: Parent module 'pymysql' not loaded, cannot perform relative import

Looks like eventlet/eventlet#81 from 5 years ago(!). Explicitly adding the module to sys.modules makes it work.

Performance is terrible while fetching new threads; as a hunch, I'd say it's taking a long time to compare each post against the in-memory version.

After running for ~150 seconds or so, inserts seem to stall, and I have no idea why. Seems to happen randomly on one of the calls to execute() or commit().

@AGSPhoenix
Copy link
Collaborator Author

pymysql works fine under CPython. Tried to test mysqlclient under PyPy (which is supported, supposedly) but it wants MySQL development sources and 5 GB of Visual C++ to compile, and fuck that.

Should check Linux where compilers are more sane.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant