Add Indexing Stack (#19305)

This commit is contained in:
Mohit Yadav 2025-01-09 22:51:49 +05:30 committed by GitHub
parent be3fdedc76
commit d66c689f6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 24 additions and 2 deletions

View File

@ -86,7 +86,10 @@ public class ElasticSearchIndexSink implements BulkSink, Closeable {
} catch (Exception e) {
entityErrorList.add(
new EntityError()
.withMessage("Failed to convert entity to request: " + e.getMessage())
.withMessage(
String.format(
"Failed to convert entity to request: %s , Stack : %s",
e.getMessage(), ExceptionUtils.exceptionStackTraceAsString(e)))
.withEntity(entity.toString()));
LOG.error("Error converting entity to request", e);
}
@ -173,6 +176,14 @@ public class ElasticSearchIndexSink implements BulkSink, Closeable {
handleNonRetriableException(requests.size(), e);
}
} catch (Exception ex) {
entityErrorList.add(
new EntityError()
.withMessage(
String.format(
"Bulk request failed: %s, StackTrace: %s",
ex.getMessage(),
ExceptionUtils.exceptionStackTraceAsString(ex)))
.withEntity(requests.toString()));
LOG.error("Bulk request retry attempt {}/{} failed", 1, maxRetries, ex);
} finally {
semaphore.release();

View File

@ -87,7 +87,10 @@ public class OpenSearchIndexSink implements BulkSink, Closeable {
} catch (Exception e) {
entityErrorList.add(
new EntityError()
.withMessage("Failed to convert entity to request: " + e.getMessage())
.withMessage(
String.format(
"Failed to convert entity to request: %s , Stack : %s",
e.getMessage(), ExceptionUtils.exceptionStackTraceAsString(e)))
.withEntity(entity.toString()));
LOG.error("Error converting entity to request", e);
}
@ -174,6 +177,14 @@ public class OpenSearchIndexSink implements BulkSink, Closeable {
handleNonRetriableException(requests.size(), e);
}
} catch (Exception ex) {
entityErrorList.add(
new EntityError()
.withMessage(
String.format(
"Bulk request failed: %s, StackTrace: %s",
ex.getMessage(),
ExceptionUtils.exceptionStackTraceAsString(ex)))
.withEntity(requests.toString()));
LOG.error("Bulk request retry attempt {}/{} failed", 1, maxRetries, ex);
} finally {
semaphore.release();