-
Notifications
You must be signed in to change notification settings - Fork 184
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
Don't re-use *Exceptions when stored in static fields if enableSuppre… #958
Conversation
@normanmaurer Same test:
failed for both PRBs, looks like something isn't happy 😢 |
@NiteshKant will check |
05fce96
to
49ef379
Compare
@normanmaurer JDK 11 build failure is due to a known flaky test: Can you add this failure details to the issue? |
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.
Just doc update suggestions, else LGTM
servicetalk-concurrent-api/src/main/java/io/servicetalk/concurrent/api/RepeatStrategies.java
Outdated
Show resolved
Hide resolved
...l/src/main/java/io/servicetalk/transport/netty/internal/StacklessClosedChannelException.java
Show resolved
Hide resolved
…ssion can not be set to false Motivation: Have a static instance of an Exception which does not set enableSuppression to false when constructed is considered to be dangerous as it may escape to the user where an user may add more exceptions to it. The problem with this is that the internal storage will grow and grow over time and never be GC'ed. This can lead to OOME situations. Modifications: Create new *Exceptions when needed and remove usage of static stored *Exceptions if needed. Result: No more risk of OOME due user calling `addSuppressed` on exceptions that are propagated through the code
…rent/api/RepeatStrategies.java Update comment Co-Authored-By: Nitesh Kant <nitesh_kant@apple.com>
2e11bb8
to
72191ba
Compare
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.
🚀
Merged... thanks :) |
…ssion can not be set to false
Motivation:
Have a static instance of an Exception which does not set enableSuppression to false when constructed is considered to be dangerous as it may escape to the user where an user may add more exceptions to it. The problem with this is that the internal storage will grow and grow over time and never be GC'ed. This can lead to OOME situations.
Modifications:
Create new *Exceptions when needed and remove usage of static stored *Exceptions if needed.
Result:
No more risk of OOME due user calling
addSuppressed
on exceptions that are propagated through the code