-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Adds sending new HeartbeatRequest protos to StreamingDataflowWorker. If any HeartbeatResponses are sent from Windmill containing failed work items, aborts processing those work items as soon as possible. * Adds sending new HeartbeatRequest protos when using streaming RPC's (streaming engine). Also adds a test. * Adds new test for custom source reader exiting early for failed work. Adds special exception for handling failed work. * removes some extra cache invalidations and unneeded log statements. * Added streaming_engine prefix to experiment enabling heartbeats and changed exception in state reader to be WorkItemFailedException. * Adds check that heartbeat response sets failed before failing work. * Adds ability to plumb experiments to test server for GrpcWindmillServerTest so we can test the new style heartbeats. * Changes StreamingDataflowWorkerTest to look for latency attribution in new-style heartbeat requests since that's what FakeWindmillServer returns now.
- Loading branch information
Showing
24 changed files
with
801 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
...ker/src/main/java/org/apache/beam/runners/dataflow/worker/WorkItemCancelledException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.apache.beam.runners.dataflow.worker; | ||
|
||
/** Indicates that the work item was cancelled and should not be retried. */ | ||
@SuppressWarnings({ | ||
"nullness" // TODO(https://github.com/apache/beam/issues/20497) | ||
}) | ||
public class WorkItemCancelledException extends RuntimeException { | ||
public WorkItemCancelledException(long sharding_key) { | ||
super("Work item cancelled for key " + sharding_key); | ||
} | ||
|
||
/** Returns whether an exception was caused by a {@link WorkItemCancelledException}. */ | ||
public static boolean isWorkItemCancelledException(Throwable t) { | ||
while (t != null) { | ||
if (t instanceof WorkItemCancelledException) { | ||
return true; | ||
} | ||
t = t.getCause(); | ||
} | ||
return false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.