Hello Alexey Serbin, Kudu Jenkins, Jordan Birdsell,

I'd like you to do a code review. Please visit

    http://gerrit.cloudera.org:8080/12515

to review the following change.


Change subject: KUDU-2686 python: remove multiprocessing
......................................................................

KUDU-2686 python: remove multiprocessing

The python multiprocessing library doesn't play very nicely when
creating Pools after initializing complex state (e.g. the KuduClient).
Because of how it forks, the library may even copy lock states, and lead
to odd situations, like multiple threads waiting on a lock that isn't
held by any thread in the process.

This was the case in KUDU-2686, which resulted in a hang in
test_scantoken.py. Upon inspection[1], there appeared to be multiple
threads in a process waiting on the same sys_futex, but none of them
held it. [2] tips some pieces to make it more reproducible (tested on
Ubuntu 14.04, where the issue was first reported).

Starting with python3.4, there is supposedly a way around this, which is
to use a different process-startup pattern, though this isn't available
in python2.

This patch removes usage of multiprocessing entirely. While it can be
argued that multiprocessing provides extra test coverage, given that
multiprocessing is known to have such issues[3][4], that this isn't the
first time we've been bitten by this forking issue, that it's test-only,
and that scan tokens are tested in the C++ client as well, "dumbing"
down the test doesn't seem unreasonable.

[1] https://gist.github.com/andrwng/d2d21c551362ddd564926c2a4ec406ae
[2] https://gist.github.com/andrwng/cc6c211c62b1235cc58944d513ba6655
[3] https://github.com/pytest-dev/pytest/issues/958
[4] https://codewithoutrules.com/2018/09/04/python-multiprocessing/

Change-Id: Ia9aa91191d54801731da27e5f132b3c96af0efa1
Reviewed-on: http://gerrit.cloudera.org:8080/12494
Tested-by: Kudu Jenkins
Reviewed-by: Jordan Birdsell <[email protected]>
Reviewed-by: Alexey Serbin <[email protected]>
---
M python/kudu/tests/test_scantoken.py
M python/setup.py
2 files changed, 4 insertions(+), 18 deletions(-)



  git pull ssh://gerrit.cloudera.org:29418/kudu refs/changes/15/12515/1
--
To view, visit http://gerrit.cloudera.org:8080/12515
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: branch-1.9.x
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia9aa91191d54801731da27e5f132b3c96af0efa1
Gerrit-Change-Number: 12515
Gerrit-PatchSet: 1
Gerrit-Owner: Andrew Wong <[email protected]>
Gerrit-Reviewer: Alexey Serbin <[email protected]>
Gerrit-Reviewer: Jordan Birdsell <[email protected]>
Gerrit-Reviewer: Kudu Jenkins (120)

Reply via email to