-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Minor : Use specific error in compression catch handle #20144
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
base: trunk
Are you sure you want to change the base?
Minor : Use specific error in compression catch handle #20144
Conversation
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.
@k-raina thanks for this patch. I have a suggestion for you.
@@ -717,7 +718,7 @@ private Optional<Builder<?>> createPushRequest(ClientTelemetrySubscription local | |||
ByteBuffer compressedPayload; | |||
try { | |||
compressedPayload = ClientTelemetryUtils.compress(payload, compressionType); | |||
} catch (Throwable e) { | |||
} catch (IOException | NoClassDefFoundError e) { | |||
log.debug("Failed to compress telemetry payload for compression: {}, sending uncompressed data", compressionType); |
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.
Perhaps the log could include the exception?
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.
What about the compressionType in the next call i.e. once NoClassDefFoundError
error is encountered then it will happen for every push hence do we want to try other compression types as supported by broker or move to compression type none
for next push?
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.
@chia7712 Addressed in comment 7f258c8
@apoorvmittal10
That makes sense! Can this functionality be added in seperate PR?
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 think there is any value in having a separete PR and we can't achieve the right way in this PR itself, we should create a jira and fix it. Else if there is something else for which you need this PR to go early then it's different, and I guess there is nothing as this new behaviour will anyways go in 4.2.
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.
@apoorvmittal10
We need to merge this PR first, to fix this workaround for users which are facing this problem in older versions of connect and schema registry jars .
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.
@k-raina catching the Throwable
is not a major issue, so there is no hurry to include it in the 4.1.0 release. Perhaps you could address @apoorvmittal10 comment in this PR, and then we could backport it to 4.1.1
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.
Thanks for the the patch. Can we pelase add test cases for the PR as well.
@@ -717,7 +718,7 @@ private Optional<Builder<?>> createPushRequest(ClientTelemetrySubscription local | |||
ByteBuffer compressedPayload; | |||
try { | |||
compressedPayload = ClientTelemetryUtils.compress(payload, compressionType); | |||
} catch (Throwable e) { | |||
} catch (IOException | NoClassDefFoundError e) { | |||
log.debug("Failed to compress telemetry payload for compression: {}, sending uncompressed data", compressionType); |
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.
What about the compressionType in the next call i.e. once NoClassDefFoundError
error is encountered then it will happen for every push hence do we want to try other compression types as supported by broker or move to compression type none
for next push?
Instead of throwable, use specific error in compression catch handle