-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Add more clear logs when oap-cluster-internal data format is inconcsistent #13059
Conversation
…ormat is inconsistent.
@@ -117,24 +117,33 @@ public void onNext(RemoteMessage message) { | |||
String nextWorkerName = message.getNextWorkerName(); | |||
RemoteData remoteData = message.getRemoteData(); | |||
|
|||
try { |
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/catch
by several others.
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 |
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 think this is unhelpful. Message doesn't have a readable toString representation
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.
This is a proto object. Isn't it output the data? I read this from decompiling codes.
@Override
public final String toString() {
return TextFormat.printer().printToString(this);
}
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.
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();
}
}
Default toString(): nextWorkerName: "dbc"
TextFormat: nextWorkerName: "dbc"
JsonFormat: {
"nextWorkerName": "dbc"
}
CHANGES
log.