-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Add more clear logs when oap-cluster-internal data format is inconcsistent #13059
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -117,24 +117,33 @@ public void onNext(RemoteMessage message) { | |
| String nextWorkerName = message.getNextWorkerName(); | ||
| RemoteData remoteData = message.getRemoteData(); | ||
|
|
||
| try { | ||
| RemoteHandleWorker handleWorker = workerInstanceGetter.get(nextWorkerName); | ||
| if (handleWorker != null) { | ||
| AbstractWorker nextWorker = handleWorker.getWorker(); | ||
| StreamData streamData = handleWorker.getStreamDataClass().newInstance(); | ||
| RemoteHandleWorker handleWorker = workerInstanceGetter.get(nextWorkerName); | ||
| if (handleWorker != null) { | ||
| AbstractWorker nextWorker = handleWorker.getWorker(); | ||
| StreamData streamData; | ||
| try { | ||
| streamData = handleWorker.getStreamDataClass().newInstance(); | ||
| } catch (Throwable t) { | ||
| remoteInErrorCounter.inc(); | ||
| LOGGER.error(t.getMessage(), t); | ||
| return; | ||
| } | ||
| try { | ||
| streamData.deserialize(remoteData); | ||
| nextWorker.in(streamData); | ||
| } else { | ||
| remoteInTargetNotFoundCounter.inc(); | ||
| LOGGER.warn( | ||
| "Work name [{}] not found. Check OAL script, make sure they are same in the whole cluster.", | ||
| nextWorkerName | ||
| ); | ||
| } catch (Throwable t) { | ||
| remoteInErrorCounter.inc(); | ||
| LOGGER.error("Can't deserialize data {}, this data is discarded.", message, t); | ||
| return; | ||
| } | ||
| } catch (Throwable t) { | ||
| remoteInErrorCounter.inc(); | ||
| LOGGER.error(t.getMessage(), t); | ||
| nextWorker.in(streamData); | ||
| } else { | ||
| remoteInTargetNotFoundCounter.inc(); | ||
| LOGGER.warn( | ||
| "Data is discarded due to worker not found. Check OAL/MAL script, make sure they are aligned in the whole cluster. The data is {}", | ||
| message | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is unhelpful. Message doesn't have a readable toString representation
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a proto object. Isn't it output the data? I read this from decompiling codes.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For safety, I run the demo codes locally public static void main(String[] args) {
RemoteMessage obj = RemoteMessage.newBuilder()
.setNextWorkerName("dbc").build();
System.out.println("Default toString(): " + obj.toString());
System.out.println("TextFormat: " + TextFormat.printer().printToString(obj));
try {
System.out.println("JsonFormat: " + JsonFormat.printer().print(obj));
} catch (Exception e) {
e.printStackTrace();
}
} |
||
| ); | ||
| } | ||
|
|
||
| } finally { | ||
| timer.finish(); | ||
| } | ||
|
|
||
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.
I don't change much. I just replaced this
try/catchby several others.