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

Stop all pools when shutting down. #488

Merged
merged 6 commits into from
Jul 14, 2016
Merged

Conversation

lukebakken
Copy link
Contributor

Incorporates #487

@lukebakken
Copy link
Contributor Author

@linkdd - thanks for the PR. Could you please run this command in your environment? The command assumes that Riak is running on localhost.

The test suite locks up when I run it. CTRL-C doesn't work, either, I have to background the process and kill -9 it. I am using Python 2.7.11

Command:

RIAK_TEST_HOST=localhost RIAK_TEST_PB_PORT=8087 RUN_CLIENT=1 python -m unittest --verbose riak.tests.test_client

Output I get:

$ RIAK_TEST_HOST=localhost RIAK_TEST_PB_PORT=8087 RUN_CLIENT=1 python -m unittest --verbose riak.tests.test_client
test_can_set_tcp_keepalive (riak.tests.test_client.ClientTests) ... ok
test_multiget_bucket (riak.tests.test_client.ClientTests) ... ok
test_multiget_errors (riak.tests.test_client.ClientTests) ... ok
test_multiget_notfounds (riak.tests.test_client.ClientTests) ... ok
test_multiget_pool_size (riak.tests.test_client.ClientTests) ... ok
test_multiput_errors (riak.tests.test_client.ClientTests) ... ok
test_multiput_pool_options (riak.tests.test_client.ClientTests) ... ok
test_multiput_pool_size (riak.tests.test_client.ClientTests) ... ok
test_pool_close (riak.tests.test_client.ClientTests) ... skipped 'RUN_POOL is 0'
test_request_retries (riak.tests.test_client.ClientTests) ... ok
test_request_retries_configurable (riak.tests.test_client.ClientTests) ... ok
test_timeout_validation (riak.tests.test_client.ClientTests) ... ok
test_uses_client_id_if_given (riak.tests.test_client.ClientTests) ... ok

----------------------------------------------------------------------
Ran 13 tests in 0.054s

OK (skipped=1)
^C^C^C^C^Z
[1]+  Stopped                 RIAK_TEST_PB_PORT=8087 RUN_CLIENT=1 python -m unittest --verbose riak.tests.test_client
lbakken@brahms ~/Projects/basho/riak-python-client (fixes/lrb/stop-pools-gh-449 *=)
$ kill -9 %1
[1]+  Killed                  RIAK_TEST_PB_PORT=8087 RUN_CLIENT=1 python -m unittest --verbose riak.tests.test_client
lbakken@brahms ~/Projects/basho/riak-python-client (fixes/lrb/stop-pools-gh-449 *=)
$ python --version
Python 2.7.11

@lukebakken
Copy link
Contributor Author

I added debugging in 9fca06c

You can see that the worker threads will never consider themselves stopped as they are all waiting on an item in the queue. Adding a timeout should resolve this, adding it now.

@@ -43,7 +43,7 @@ test: setup test_normal test_security
test_normal:
@echo "Testing Riak Python Client (without security)"
@$(RIAK_ADMIN) security disable
@RIAK_TEST_PROTOCOL='pbc' RIAK_TEST_PB_PORT=8087 RUN_POOL=1 RUN_BTYPES=1 RUN_CLIENT=1 RUN_MAPREDUCE=1 RUN_KV=1 RUN_RESOLVE=1 RUN_YZ=1 RUN_DATATYPES=1 RUN_INDEXES=1 ./tox_runner.sh ..
Copy link

Choose a reason for hiding this comment

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

@lukebakken Are these now obsolete?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No, I added RUN_POOL a commit or so ago just for kicks. No need to run them every time. And, they don't have anything to do with the multi-pools, anyway, they are tests of a the generic Pool class that the TCP and HTTP connection pools use.

@lukebakken lukebakken merged commit 25979e6 into master Jul 14, 2016
@lukebakken lukebakken deleted the fixes/lrb/stop-pools-gh-449 branch July 14, 2016 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants