Skip to content

Commit

Permalink
Add log for exceptions when processing DynamoDB shards
Browse files Browse the repository at this point in the history
Signed-off-by: Taylor Gray <tylgry@amazon.com>
  • Loading branch information
graytaylor0 committed Nov 19, 2024
1 parent 72fa423 commit e559d63
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
import java.util.concurrent.atomic.AtomicLong;
import java.util.function.BiConsumer;

import static org.opensearch.dataprepper.logging.DataPrepperMarkers.NOISY;

/**
* A scheduler to manage all the stream related work in one place
*/
Expand Down Expand Up @@ -100,6 +102,8 @@ private void processStreamPartition(StreamPartition streamPartition) {
runConsumer.whenComplete((v, ex) -> {
numOfWorkers.decrementAndGet();
if (ex != null) {
LOG.error(NOISY, "Received exception while processing shard {}, giving up this shard for reprocessing: {}",
streamPartition.getShardId(), ex);
coordinator.giveUpPartition(streamPartition);
}
if (numOfWorkers.get() == 0) {
Expand Down

0 comments on commit e559d63

Please sign in to comment.