Bikramjeet Vig has posted comments on this change. ( http://gerrit.cloudera.org:8080/12926 )
Change subject: IMPALA-7031: Add additional info to query canceled from http endpoint ...................................................................... Patch Set 11: (5 comments) http://gerrit.cloudera.org:8080/#/c/12926/11//COMMIT_MSG Commit Message: http://gerrit.cloudera.org:8080/#/c/12926/11//COMMIT_MSG@7 PS11, Line 7: IMPALA-7031: Add additional info to query canceled from http endpoint : : When a running query is canceled from the http endpoint, the query will : be unregistered. This can result in a scenario where a client that has : a reference to the query handle is unaware that the query has been : unregistered via http endpoint, and attempts to run an operation on : that query handle but encounters "Invalid query handle" error. : From the user prospective the error is not indicative, therefore the : patch added additional information to the error to notify that the query : is already unregistered. : : Testing: : - Added a test to test_web_pages.py : - Ran all webserver tests update commit message to reflect change of approach from initially changing the http endpoint behavior to now adding info to the error message if the query was recently cancelled. http://gerrit.cloudera.org:8080/#/c/12926/11/be/src/service/impala-beeswax-server.cc File be/src/service/impala-beeswax-server.cc: http://gerrit.cloudera.org:8080/#/c/12926/11/be/src/service/impala-beeswax-server.cc@257 PS11, Line 257: nit: remove newline http://gerrit.cloudera.org:8080/#/c/12926/11/be/src/service/impala-server.cc File be/src/service/impala-server.cc: http://gerrit.cloudera.org:8080/#/c/12926/11/be/src/service/impala-server.cc@2586 PS11, Line 2586: Query is unregistered, if it can be found in query log nit: Query was recently unregistered if it can be found in the query log http://gerrit.cloudera.org:8080/#/c/12926/11/be/src/service/impala-server.cc@2586 PS11, Line 2586: // Query is unregistered, if it can be found in query log you need to hold query_log_lock_ before accessing the query_log_index_ http://gerrit.cloudera.org:8080/#/c/12926/11/tests/webserver/test_web_pages.py File tests/webserver/test_web_pages.py: http://gerrit.cloudera.org:8080/#/c/12926/11/tests/webserver/test_web_pages.py@547 PS11, Line 547: @pytest.mark.execute_serially : def test_cancel_query_by_http_endpoint(self): : """Verify that an indicative error message is returned when trying to use a query : handle for a recently cancelled query. That kind of message is returned if the query : is still in the query archive log, so to make sure it is not pushed out of the log by : other queries we run this test serially.""" : try: : # Runs a query and then cancels it by http endpoint : query = "select count(*) from functional.alltypes where bool_col = sleep(1000)" : query_handle = self.client.execute_async(query) : responses = self.get_and_check_status(self.ROOT_URL : + "/cancel_query?query_id=" : + query_handle.get_handle().id, : ports_to_test=[25000]) : assert "Query cancellation successful" in responses[0].text,\ : "Query is not canceled:\n" + responses[0].text : # Client requests state for the unregistered query : self.client.get_state(query_handle) : except ImpalaBeeswaxException as e: : assert "Invalid query handle. The query is already unregistered" in str(e),\ : "Encountered unexpected exception:\n"\ : + str(e) move this to test_cancellation and cancel the query regularly using the client -- To view, visit http://gerrit.cloudera.org:8080/12926 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: Impala-ASF Gerrit-Branch: master Gerrit-MessageType: comment Gerrit-Change-Id: I56983d40e0542bc734ec5a66c339b5131b7b56c8 Gerrit-Change-Number: 12926 Gerrit-PatchSet: 11 Gerrit-Owner: Alice Fan <[email protected]> Gerrit-Reviewer: Alice Fan <[email protected]> Gerrit-Reviewer: Bikramjeet Vig <[email protected]> Gerrit-Reviewer: Impala Public Jenkins <[email protected]> Gerrit-Comment-Date: Fri, 10 May 2019 00:50:56 +0000 Gerrit-HasComments: Yes
