You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "beliefer (via GitHub)" <gi...@apache.org> on 2025/04/16 06:14:36 UTC

[PR] [hotfix] Avoid invalid thread for state reader [flink]

beliefer opened a new pull request, #26465:
URL: https://github.com/apache/flink/pull/26465

   ## What is the purpose of the change
   
   This PR aims to avoid invalid thread for state reader.
   
   
   ## Brief change log
   
   Avoid invalid thread for state reader.
   
   
   ## Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): (no)
     - The public API, i.e., is any changed class annotated with `@Public(Evolving)`: (no)
     - The serializers: (no)
     - The runtime per-record code paths (performance sensitive): (no)
     - Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: (no)
     - The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
   


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [hotfix] Avoid invalid thread for state reader [flink]

Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #26465:
URL: https://github.com/apache/flink/pull/26465#discussion_r2046350493


##########
flink-runtime/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java:
##########
@@ -862,15 +862,17 @@ private CompletableFuture<Void> restoreStateAndGates(
                 INITIALIZE_STATE_DURATION, initializeStateEndTs - readOutputDataTs);
         IndexedInputGate[] inputGates = getEnvironment().getAllInputGates();
 
-        channelIOExecutor.execute(
-                () -> {
-                    try {
-                        reader.readInputData(inputGates);
-                    } catch (Exception e) {
-                        asyncExceptionHandler.handleAsyncException(
-                                "Unable to read channel state", e);
-                    }
-                });
+        if (inputGates.length > 0) {

Review Comment:
   nit: prior to the fix there was an Exception now we issue the return. I think there should be a test for this, as there is a change in behaviour.  



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [hotfix] Avoid invalid thread for state reader [flink]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26465:
URL: https://github.com/apache/flink/pull/26465#issuecomment-4385868094

   This PR is being marked as stale since it has not had any activity in the last 90 days. 
   If you would like to keep this PR alive, please leave a comment asking for a review. 
   If the PR has merge conflicts, update it with the latest from the base branch.
   
   If you are having difficulty finding a reviewer, please reach out to the 
   community, contact details can be found here: https://flink.apache.org/what-is-flink/community/
   
   If this PR is no longer valid or desired, please feel free to close it. 
   If no activity occurs in the next 30 days, it will be automatically closed.


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [hotfix] Avoid invalid thread for state reader [flink]

Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #26465:
URL: https://github.com/apache/flink/pull/26465#issuecomment-2808500404

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "f14a1a16de56dc18496b01431dbf05c30589eec5",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "f14a1a16de56dc18496b01431dbf05c30589eec5",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * f14a1a16de56dc18496b01431dbf05c30589eec5 UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [hotfix] Avoid invalid thread for state reader [flink]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #26465:
URL: https://github.com/apache/flink/pull/26465#issuecomment-4629322161

   This PR has been closed since it has not had any activity in 120 days. 
   If you feel like this was a mistake, or you would like to continue working on it, 
   please feel free to re-open the PR and ask for a review.


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [hotfix] Avoid invalid thread for state reader [flink]

Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on code in PR #26465:
URL: https://github.com/apache/flink/pull/26465#discussion_r2046587512


##########
flink-runtime/src/main/java/org/apache/flink/streaming/runtime/tasks/StreamTask.java:
##########
@@ -862,15 +862,17 @@ private CompletableFuture<Void> restoreStateAndGates(
                 INITIALIZE_STATE_DURATION, initializeStateEndTs - readOutputDataTs);
         IndexedInputGate[] inputGates = getEnvironment().getAllInputGates();
 
-        channelIOExecutor.execute(
-                () -> {
-                    try {
-                        reader.readInputData(inputGates);
-                    } catch (Exception e) {
-                        asyncExceptionHandler.handleAsyncException(
-                                "Unable to read channel state", e);
-                    }
-                });
+        if (inputGates.length > 0) {

Review Comment:
   There are many test cases trigger this case, such as testFailingAsyncCheckpointRunnable, testStateBackendLoadingAndClosing, testHandleAsyncExceptionDuringRestoring, testProcessWithUnAvailableOutput, testProcessWithRaceInDataAvailability, testEmptySubtaskStateLeadsToStatelessAcknowledgment, testStateBackendClosingOnFailure, testExecuteMailboxActionsAfterLeavingInputProcessorMailboxLoop, testUncaughtExceptionInAsynchronousCheckpointingOperation, testDecliningCheckpointStreamOperator, testProcessWithUnAvailableInput, testAsyncCheckpointingConcurrentCloseAfterAcknowledge, testAsyncCheckpointingConcurrentCloseBeforeAcknowledge, testThreadInvariants, testTaskAvoidHangingAfterSnapshotStateThrownException, testMailboxMetricsScheduling, testRestorePerformedOnlyOnce, testRestorePerformedFromInvoke, testEarlyCanceling, testProcessWithAvailableOutput, testQuiesceOfMailboxRightBeforeSubmittingActionViaTimerService in StreamTaskTest



-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [hotfix] Avoid invalid thread for state reader [flink]

Posted by "beliefer (via GitHub)" <gi...@apache.org>.
beliefer commented on PR #26465:
URL: https://github.com/apache/flink/pull/26465#issuecomment-2809095381

   ping @zhijiangW @rkhachatryan @AHeise cc @1996fanrui @davidradl @GOODBOY008 


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [hotfix] Avoid invalid thread for state reader [flink]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #26465: [hotfix] Avoid invalid thread for state reader
URL: https://github.com/apache/flink/pull/26465


-- 
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: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org