[ 
https://issues.apache.org/jira/browse/HIVE-25898?focusedWorklogId=720096&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-720096
 ]

ASF GitHub Bot logged work on HIVE-25898:
-----------------------------------------

                Author: ASF GitHub Bot
            Created on: 03/Feb/22 13:02
            Start Date: 03/Feb/22 13:02
    Worklog Time Spent: 10m 
      Work Description: veghlaci05 commented on a change in pull request #2981:
URL: https://github.com/apache/hive/pull/2981#discussion_r798540039



##########
File path: ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/Worker.java
##########
@@ -715,28 +705,26 @@ void wasSuccessful() {
      * @throws Exception
      */
     @Override public void close() throws Exception {
+      //the transaction is about to close, we can stop heartbeating regardless 
of it's state
+      shutdownHeartbeater();
       if (status != TxnStatus.UNKNOWN) {
-        // turn off error logging in heartbeater in case of race condition 
between commit/abort and heartbeating
-        heartbeater.shouldLogError(false);
         if (succeessfulCompaction) {
           commit();
         } else {
           abort();
         }
       }
-      shutdownHeartbeater();
     }
 
     private void shutdownHeartbeater() {
       if (heartbeatExecutor != null) {
         heartbeatExecutor.shutdownNow();
         try {
           if (!heartbeatExecutor.awaitTermination(5, TimeUnit.SECONDS)) {
-            heartbeatExecutor.shutdownNow();
+            LOG.debug("Heartbeating for transaction {} did not stop in 5 
seconds, do not wait any longer.", this);
           }
-          LOG.debug("Successfully stopped heartbeating for transaction {}", 
this);
         } catch (InterruptedException ex) {
-          heartbeatExecutor.shutdownNow();
+          //Caller thread was interrupted while waiting for heartbeater to 
terminate, nothing to do

Review comment:
       I don't think it is necessary, that log would be sth like "Compaction 
was aborted while waiting for the heartbeater to shut down" which doesn't add 
too much in my opinion




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 720096)
    Time Spent: 2.5h  (was: 2h 20m)

> Compaction txn heartbeating after Worker timeout
> ------------------------------------------------
>
>                 Key: HIVE-25898
>                 URL: https://issues.apache.org/jira/browse/HIVE-25898
>             Project: Hive
>          Issue Type: Bug
>          Components: Hive
>            Reporter: László Végh
>            Assignee: László Végh
>            Priority: Major
>              Labels: pull-request-available
>          Time Spent: 2.5h
>  Remaining Estimate: 0h
>
> In some cases, when the compaction transaction is aborted, the hearbeater 
> thread is not shut down and keeps heartbeating.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to