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

fix: ignore errors in GetLog #15181

Merged
merged 1 commit into from
Jun 15, 2021

Conversation

betodealmeida
Copy link
Member

@betodealmeida betodealmeida commented Jun 15, 2021

SUMMARY

We're seeing errors in Databricks that say:

databricks error: Couldn't find log associated with operation handle: OperationHandle [opType=EXECUTE_STATEMENT, getHandleIdentifier()=bbb31ca6-63bf-40f7-8724-f4d5856522e2]

Searching for the message suggests that this happens when the Hive2 server can't retrieve logs, but the results should still be there. I added a try/except block when fetching logs, trying to fix the problem.

BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF

N/A

TESTING INSTRUCTIONS

I was able to reproduce the problem locally. The call for fetch_logs raised this exception:

TFetchResultsResp(status=TStatus(statusCode=3, infoMessages=["*org.apache.hive.service.cli.HiveSQLException:Couldn't find log associated with operation handle: OperationHandle [opType=EXECUTE_STATEMENT, getHandleIdentifier()=65bc061c-482b-4ed3-a26a-f45013d89f4c]:48:47", 'org.apache.hive.service.cli.operation.OperationManager:getOperationLogRowSet:OperationManager.java:286', 'org.apache.hive.service.cli.session.HiveSessionImpl:fetchResults:HiveSessionImpl.java:876', 'org.apache.hive.service.cli.CLIService:fetchResults:CLIService.java:578', 'org.apache.hive.service.cli.thrift.ThriftCLIService:FetchResults:ThriftCLIService.java:876', 'org.apache.hive.service.rpc.thrift.TCLIService$Processor$FetchResults:getResult:TCLIService.java:1717', 'org.apache.hive.service.rpc.thrift.TCLIService$Processor$FetchResults:getResult:TCLIService.java:1702', 'org.apache.thrift.ProcessFunction:process:ProcessFunction.java:38', 'org.apache.thrift.TBaseProcessor:process:TBaseProcessor.java:39', 'org.apache.thrift.server.TServlet:doPost:TServlet.java:83', 'org.apache.hive.service.cli.thrift.ThriftHttpServlet:doPost:ThriftHttpServlet.java:195', 'javax.servlet.http.HttpServlet:service:HttpServlet.java:707', 'javax.servlet.http.HttpServlet:service:HttpServlet.java:790', 'org.eclipse.jetty.servlet.ServletHolder:handle:ServletHolder.java:791', 'org.eclipse.jetty.servlet.ServletHandler:doHandle:ServletHandler.java:550', 'org.eclipse.jetty.server.handler.ScopedHandler:handle:ScopedHandler.java:143', 'org.eclipse.jetty.security.SecurityHandler:handle:SecurityHandler.java:602', 'org.eclipse.jetty.server.handler.HandlerWrapper:handle:HandlerWrapper.java:127', 'org.eclipse.jetty.server.handler.ScopedHandler:nextHandle:ScopedHandler.java:235', 'org.eclipse.jetty.server.session.SessionHandler:doHandle:SessionHandler.java:1624', 'org.eclipse.jetty.server.handler.ScopedHandler:nextHandle:ScopedHandler.java:233', 'org.eclipse.jetty.server.handler.ContextHandler:doHandle:ContextHandler.java:1435', 'org.eclipse.jetty.server.handler.ScopedHandler:nextScope:ScopedHandler.java:188', 'org.eclipse.jetty.servlet.ServletHandler:doScope:ServletHandler.java:501', 'org.eclipse.jetty.server.session.SessionHandler:doScope:SessionHandler.java:1594', 'org.eclipse.jetty.server.handler.ScopedHandler:nextScope:ScopedHandler.java:186', 'org.eclipse.jetty.server.handler.ContextHandler:doScope:ContextHandler.java:1350', 'org.eclipse.jetty.server.handler.ScopedHandler:handle:ScopedHandler.java:141', 'org.eclipse.jetty.server.handler.HandlerWrapper:handle:HandlerWrapper.java:127', 'org.eclipse.jetty.server.Server:handle:Server.java:516', 'org.eclipse.jetty.server.HttpChannel:lambda$handle$1:HttpChannel.java:388', 'org.eclipse.jetty.server.HttpChannel:dispatch:HttpChannel.java:633', 'org.eclipse.jetty.server.HttpChannel:handle:HttpChannel.java:380', 'org.eclipse.jetty.server.HttpConnection:onFillable:HttpConnection.java:273', 'org.eclipse.jetty.io.AbstractConnection$ReadCallback:succeeded:AbstractConnection.java:311', 'org.eclipse.jetty.io.FillInterest:fillable:FillInterest.java:105', 'org.eclipse.jetty.io.ssl.SslConnection$DecryptedEndPoint:onFillable:SslConnection.java:540', 'org.eclipse.jetty.io.ssl.SslConnection:onFillable:SslConnection.java:395', 'org.eclipse.jetty.io.ssl.SslConnection$2:succeeded:SslConnection.java:161', 'org.eclipse.jetty.io.FillInterest:fillable:FillInterest.java:105', 'org.eclipse.jetty.io.ChannelEndPoint$1:run:ChannelEndPoint.java:104', 'org.eclipse.jetty.util.thread.strategy.EatWhatYouKill:runTask:EatWhatYouKill.java:336', 'org.eclipse.jetty.util.thread.strategy.EatWhatYouKill:doProduce:EatWhatYouKill.java:313', 'org.eclipse.jetty.util.thread.strategy.EatWhatYouKill:tryProduce:EatWhatYouKill.java:171', 'org.eclipse.jetty.util.thread.strategy.EatWhatYouKill:run:EatWhatYouKill.java:129', 'org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread:run:ReservedThreadExecutor.java:375', 'java.util.concurrent.ThreadPoolExecutor:runWorker:ThreadPoolExecutor.java:1149', 'java.util.concurrent.ThreadPoolExecutor$Worker:run:ThreadPoolExecutor.java:624', 'java.lang.Thread:run:Thread.java:748'], sqlState=None, errorCode=0, errorMessage="Couldn't find log associated with operation handle: OperationHandle [opType=EXECUTE_STATEMENT, getHandleIdentifier()=65bc061c-482b-4ed3-a26a-f45013d89f4c]"), hasMoreRows=None, results=None)%

With this PR the exception is ignored (but logged), and the results are displayed correctly.

ADDITIONAL INFORMATION

  • Has associated issue:
  • Changes UI
  • Includes DB Migration (follow approval process in SIP-59)
    • Migration is atomic, supports rollback & is backwards-compatible
    • Confirm DB migration upgrade and downgrade tested
    • Runtime estimates and downtime expectations provided
  • Introduces new feature or API
  • Removes existing feature or API

@codecov
Copy link

codecov bot commented Jun 15, 2021

Codecov Report

Merging #15181 (7b9c11e) into master (e2abf59) will decrease coverage by 0.16%.
The diff coverage is 0.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #15181      +/-   ##
==========================================
- Coverage   77.41%   77.25%   -0.17%     
==========================================
  Files         969      969              
  Lines       49982    49999      +17     
  Branches     6422     6422              
==========================================
- Hits        38692    38625      -67     
- Misses      11087    11171      +84     
  Partials      203      203              
Flag Coverage Δ
hive ?
mysql 81.69% <0.00%> (-0.02%) ⬇️
postgres 81.70% <0.00%> (-0.02%) ⬇️
python 81.79% <0.00%> (-0.31%) ⬇️
sqlite 81.33% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
superset/db_engine_specs/hive.py 69.20% <0.00%> (-18.20%) ⬇️
superset/db_engines/hive.py 0.00% <0.00%> (-82.15%) ⬇️
superset/exceptions.py 93.50% <0.00%> (-5.20%) ⬇️
superset/views/database/mixins.py 81.03% <0.00%> (-1.73%) ⬇️
superset/db_engine_specs/presto.py 83.36% <0.00%> (-1.06%) ⬇️
superset/db_engine_specs/bigquery.py 89.62% <0.00%> (-0.53%) ⬇️
superset/db_engine_specs/base.py 87.97% <0.00%> (-0.41%) ⬇️
superset/connectors/sqla/models.py 88.15% <0.00%> (-0.24%) ⬇️
superset/utils/core.py 88.93% <0.00%> (-0.13%) ⬇️
... and 3 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e2abf59...7b9c11e. Read the comment docs.

@betodealmeida betodealmeida merged commit ffdbcbd into apache:master Jun 15, 2021
@henryyeh
Copy link
Contributor

🏷️ 2021.21

@henryyeh
Copy link
Contributor

🏷️ 2021.23

henryyeh pushed a commit to preset-io/superset that referenced this pull request Jun 16, 2021
henryyeh pushed a commit to preset-io/superset that referenced this pull request Jun 17, 2021
cccs-RyanS pushed a commit to CybercentreCanada/superset that referenced this pull request Dec 17, 2021
QAlexBall pushed a commit to QAlexBall/superset that referenced this pull request Dec 29, 2021
cccs-rc pushed a commit to CybercentreCanada/superset that referenced this pull request Mar 6, 2024
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 1.3.0 labels Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels preset:2021.21 preset:2021.23 size/XS 🚢 1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants