-
Notifications
You must be signed in to change notification settings - Fork 30
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
More context on throws #453
More context on throws #453
Conversation
…as being dropped. This can create an error down the line if the underlying implementation changes, even if it works now. I've also removed a getValue() that didn't do anything. Signed-off-by: Greg Schohn <[email protected]>
… RequestKey.toString(). Also pass the request key through ParsedHttpMessagesAsDicts so that the request key is present in the (which I've just realized should be sending back optionals or sneaky throws & letting the callers do this conversion... next change). Signed-off-by: Greg Schohn <[email protected]>
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #453 +/- ##
============================================
- Coverage 76.86% 71.16% -5.70%
+ Complexity 1151 1144 -7
============================================
Files 145 121 -24
Lines 5887 4890 -997
Branches 542 432 -110
============================================
- Hits 4525 3480 -1045
- Misses 1080 1138 +58
+ Partials 282 272 -10
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Signed-off-by: Greg Schohn <[email protected]> # Conflicts: # TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/datatypes/PojoTrafficStreamKey.java # TrafficCapture/trafficReplayer/src/main/java/org/opensearch/migrations/replay/kafka/KafkaProtobufConsumer.java
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor linting and typo changes should be updated by no need to re-review.
log.warn("Terminating a TrafficStream reconstruction w/out an accumulated value, " + | ||
"assuming an empty server interaction and NOT reproducing this to the target cluster."); | ||
log.atWarn().setMessage("Terminating a TrafficStream reconstruction before data was accumulated " + | ||
"for " + accumulation.trafficChannelKey + "assuming an empty server interaction and NOT " + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add space before 'assuming'.
log.warn("Putting what may be a bogus value in the output because transforming it " + | ||
"into json threw an exception"); | ||
// TODO - this isn't a good design choice. | ||
// We should follow through with the spirit of this class and leave thes as empty optional values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thes --> this
@@ -171,7 +172,7 @@ private <T> void scheduleOnConnectionReplaySession(ISourceTrafficChannelKey chan | |||
eventLoop.schedule(task, getDelayFromNowMs(atTime), TimeUnit.MILLISECONDS); | |||
scheduledFuture.addListener(f->{ | |||
if (!f.isSuccess()) { | |||
log.atError().setCause(f.cause()).setMessage(()->"Error scheduling task").log(); | |||
log.atError().setCause(f.cause()).setMessage(()->"Error scheduling task for "+channelKey).log(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spacing
@@ -922,7 +923,7 @@ private static String formatWorkItem(DiagnosticTrackableCompletableFuture<String | |||
} | |||
|
|||
public @NonNull CompletableFuture<Void> shutdown(Error error) { | |||
log.warn("Shutting down "+this+" because of "+error); | |||
log.atWarn().setCause(error).setMessage(()->"Shutting down "+this+" because of error").log(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
spacing
* block calls to readNextTrafficStreamChunk() until some time window elapses. This | ||
* could be a very large window in cases where there were long gaps between recorded | ||
* requests from the capturing proxy. For example, if a TrafficStream is read and it | ||
* that stream is scheduled to be run one hour later, readNextTrafficStreamChunk() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
update: read and if* that stream is scheduled
Description
Some warning log messages were missing some critical context. I made a sweep through all error/warn messages and added an appropriate amount of context to those that were lacking.
Testing
unit tests
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.