{"action":"closed","issue":{"url":"https://api.github.com/repos/mogui/pyorient/issues/64","labels_url":"https://api.github.com/repos/mogui/pyorient/issues/64/labels{/name}","comments_url":"https://api.github.com/repos/mogui/pyorient/issues/64/comments","events_url":"https://api.github.com/repos/mogui/pyorient/issues/64/events","html_url":"https://github.com/mogui/pyorient/issues/64","id":72106404,"number":64,"title":"OrientPy vs. concurrent.futures' ProcessPoolExecutor (pickling?)","user":{"login":"shongololo","id":4347878,"avatar_url":"https://avatars.githubusercontent.com/u/4347878?v=3","gravatar_id":"","url":"https://api.github.com/users/shongololo","html_url":"https://github.com/shongololo","followers_url":"https://api.github.com/users/shongololo/followers","following_url":"https://api.github.com/users/shongololo/following{/other_user}","gists_url":"https://api.github.com/users/shongololo/gists{/gist_id}","starred_url":"https://api.github.com/users/shongololo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shongololo/subscriptions","organizations_url":"https://api.github.com/users/shongololo/orgs","repos_url":"https://api.github.com/users/shongololo/repos","events_url":"https://api.github.com/users/shongololo/events{/privacy}","received_events_url":"https://api.github.com/users/shongololo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-30T09:12:09Z","updated_at":"2015-05-01T14:15:25Z","closed_at":"2015-05-01T14:15:25Z","body":"I am using a concurrent.futures instance of a ProcessPoolExecutor in a script. In the same script, I am using OrientPy to make queries to a database.\r\n\r\nThe script instantiates a class, inside of which, the query is made first, then the results are retrieved and sorted into a list, and then a ProcessPool Executor instance is created for processing the results in parallel.\r\n\r\nHowever, this error message occurs, presumably due to pickling issues, even though OrientPy itself is not needed for the ensuing function that processes the results:\r\n<code>\r\nTraceback (most recent call last):\r\n  File \"/Users/shongololo/anaconda/lib/python3.4/site-packages/pyorient-1.4-py3.4.egg/pyorient/orient.py\", line 331, in get_message\r\n    if command is not None and self._Messages[command]:\r\nKeyError: 'GetstateMessage'\r\n\r\nDuring handling of the above exception, another exception occurred:\r\n\r\nTraceback (most recent call last):\r\n  File \"/Users/shongololo/anaconda/lib/python3.4/multiprocessing/queues.py\", line 242, in _feed\r\n    obj = ForkingPickler.dumps(obj)\r\n  File \"/Users/shongololo/anaconda/lib/python3.4/multiprocessing/reduction.py\", line 50, in dumps\r\n    cls(buf, protocol).dump(obj)\r\n  File \"/Users/shongololo/anaconda/lib/python3.4/site-packages/pyorient-1.4-py3.4.egg/pyorient/orient.py\", line 188, in __getattr__\r\n    _Message = self.get_message(_names + \"Message\")\r\n  File \"/Users/shongololo/anaconda/lib/python3.4/site-packages/pyorient-1.4-py3.4.egg/pyorient/orient.py\", line 349, in get_message\r\n    \"Unable to find command \" + str(e), []\r\npyorient.exceptions.PyOrientBadMethodCallException: Unable to find command 'GetstateMessage'\r\n</code>\r\n\r\nSince this exists inside a Class, I suspect that the reason is that ProcessPoolExecutor is pickling the entire class (or at least selected other portions?) whilst creating the pickled function.\r\n\r\nOne solution would be to make the function fully stand-alone outside of the class (and initial tests seem to indicate that this might work), however, I'm wondering if it is possible to make OrientPy somehow more generally compatible with pickling for cases when this is not possible? "}}