Skip to content

Commit

Permalink
Logging failure should fail open
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhilsimha committed Jan 31, 2024
1 parent e663aef commit d7decc9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion online/src/main/scala/ai/chronon/online/Fetcher.scala
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,8 @@ class Fetcher(val kvStore: KVStore,
codec.loggingSchemaHash
)
if (logFunc != null) {
logFunc.accept(loggableResponse)
val sentLog = Try(logFunc.accept(loggableResponse))
if (sentLog.isFailure) logger.error("Failed to publish log", sentLog.failed.get)
joinContext.foreach(context => context.increment("logging_request.count"))
joinContext.foreach(context =>
context.distribution("logging_request.latency.millis", System.currentTimeMillis() - loggingStartTs))
Expand Down

0 comments on commit d7decc9

Please sign in to comment.