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

Kinesis: more descriptive Source error log #2224

Merged
merged 1 commit into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ object KinesisErrors {
sealed trait KinesisSourceError extends NoStackTrace
case object NoShardsError extends KinesisSourceError
class GetShardIteratorError(val shardId: String, e: Throwable)
extends RuntimeException(s"Failed to get a shard iterator for shard [$shardId]", e)
extends RuntimeException(s"Failed to get a shard iterator for shard [$shardId]. Reason : ${e.getMessage}", e)
with KinesisSourceError
class GetRecordsError(val shardId: String, e: Throwable)
extends RuntimeException(s"Failed to fetch records from Kinesis for shard [$shardId]", e)
extends RuntimeException(s"Failed to fetch records from Kinesis for shard [$shardId]. Reason : ${e.getMessage}",
e)
with KinesisSourceError

sealed trait KinesisFlowErrors extends NoStackTrace
case class FailurePublishingRecords(e: Throwable)
extends RuntimeException("Failure publishing records to Kinesis", e)
extends RuntimeException(s"Failure publishing records to Kinesis. Reason : ${e.getMessage}", e)
with KinesisFlowErrors
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,9 @@ private[kinesis] class KinesisSourceStage(shardSettings: ShardSettings, amazonKi
requestRecords()

case (_, GetShardIteratorFailure(ex)) =>
log.error(ex, "Failed to get a shard iterator for shard {}", shardId)
failStage(new Errors.GetShardIteratorError(shardId, ex))
val error = new Errors.GetShardIteratorError(shardId, ex)
log.error(ex, error.getMessage)
failStage(error)

case (_, Pump) =>
case (_, msg) =>
Expand All @@ -104,8 +105,9 @@ private[kinesis] class KinesisSourceStage(shardSettings: ShardSettings, amazonKi
}

case (_, GetRecordsFailure(ex)) =>
log.error(ex, "Failed to fetch records from Kinesis for shard {}", shardId)
failStage(new Errors.GetRecordsError(shardId, ex))
val error = new Errors.GetRecordsError(shardId, ex)
log.error(ex, error.getMessage)
failStage(error)

case (_, Pump) =>
case (_, msg) =>
Expand Down