-
Notifications
You must be signed in to change notification settings - Fork 148
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
Fixes for resource leaks #24616
Merged
Merged
Fixes for resource leaks #24616
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
My past me sent a message :D
|
dmatej
force-pushed
the
resource-leaks
branch
from
November 14, 2023 16:30
63a30f6
to
800e0e5
Compare
dmatej
force-pushed
the
resource-leaks
branch
from
January 15, 2024 18:48
800e0e5
to
bcbce8c
Compare
dmatej
force-pushed
the
resource-leaks
branch
from
January 26, 2024 07:10
bcbce8c
to
3bd756a
Compare
dmatej
force-pushed
the
resource-leaks
branch
from
February 13, 2024 19:07
3bd756a
to
7cd8f3f
Compare
- Using try-with - Safer ZipEntry management, new closeable WritableArchiveEntry - Revisited FileUtils - deleted unused methods - added USER_HOME file - new ensureWritableDir method; if the directory cannot be used or created, throws ISE - ProprietaryReader.readFrom closes the input OR sets that to a returned object - The behavior is not much consistent and I don't like it, but now it is documented and better controlled. - Implementations are final to limit risks. - Fix: MIMEMessage is closeable! - Fix: JsonParser doesn't close the input if it is a stream! - AsadminSecurityUtil.GF_CLIENT_DIR constant - by default subdir in user's home as it was before this commit - can be reset by GF_CLIENT_DIR environment property. - MUST be writeable, client should crash otherwise. - ArchivistUtils deleted - duplicit to FileUtils Signed-off-by: David Matějček <[email protected]>
- Safer impl without resource leaks (I hope, there's yet one class with really wide scope and also some finalizers, should be revisited later again). - More logs - it is hard to find what is wrong when it just does something in the background. - I wanted to write some tests around DeploymentContext, but it has too many dependencies, so it is covered just by integration tests (persistence_all ie) Signed-off-by: David Matějček <[email protected]> # Conflicts: # appserver/tests/testcontainers/src/test/java/org/glassfish/main/test/tc/GlassFishContainer.java
Signed-off-by: David Matějček <[email protected]>
Signed-off-by: David Matějček <[email protected]> # Conflicts: # appserver/tests/testcontainers/pom.xml # appserver/tests/testcontainers/src/test/java/org/glassfish/main/test/tc/DomainRestartITest.java # appserver/tests/testcontainers/src/test/java/org/glassfish/main/test/tc/GlassFishContainer.java
Signed-off-by: David Matějček <[email protected]> # Conflicts: # appserver/tests/testcontainers/pom.xml # appserver/tests/testcontainers/src/test/java/org/glassfish/main/test/tc/GlassFishContainer.java
Signed-off-by: David Matějček <[email protected]>
Signed-off-by: David Matějček <[email protected]>
- it has to be refactored or rewritten to a more robust state Signed-off-by: David Matějček <[email protected]>
Signed-off-by: David Matějček <[email protected]> # Conflicts: # appserver/jms/jms-core/src/main/java/com/sun/enterprise/connectors/jms/system/JmsProviderLifecycle.java
Signed-off-by: David Matějček <[email protected]>
Signed-off-by: David Matějček <[email protected]>
dmatej
force-pushed
the
resource-leaks
branch
from
February 20, 2024 18:06
cd41a2c
to
5872a8e
Compare
dmatej
requested review from
arjantijms,
pzygielo,
hs536,
avpinchuk and
kaido207
February 20, 2024 19:54
hs536
reviewed
Feb 21, 2024
...in/util/src/main/java/com/sun/enterprise/admin/remote/reader/MultipartProprietaryReader.java
Outdated
Show resolved
Hide resolved
hs536
reviewed
Feb 21, 2024
...main/java/com/sun/enterprise/admin/remote/reader/ProgressStatusDTOJsonProprietaryReader.java
Show resolved
Hide resolved
hs536
reviewed
Feb 21, 2024
...in/java/com/sun/enterprise/admin/remote/reader/ProgressStatusEventJsonProprietaryReader.java
Show resolved
Hide resolved
hs536
reviewed
Feb 21, 2024
nucleus/cluster/cli/src/main/java/com/sun/enterprise/admin/cli/cluster/SetupSshKey.java
Outdated
Show resolved
Hide resolved
Signed-off-by: David Matějček <[email protected]>
hs536
approved these changes
Feb 21, 2024
avpinchuk
approved these changes
Feb 21, 2024
arjantijms
approved these changes
Feb 21, 2024
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.
LGTM. TBH, didn't read each and every line.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I have this branch here since November 2022, rebasing it from time to time. Perhaps it would be good to merge it.
Summary of Changes:
try-with
ZipEntry
management, new closeableWritableArchiveEntry
FileUtils
USER_HOME
fileensureWritableDir
method; if the directory cannot be used or created, throws ISEProprietaryReader.readFrom
closes the input OR sets that to a returned objectMIMEMessage
is closeable!JsonParser
doesn't close the input if it is a stream!AsadminSecurityUtil.GF_CLIENT_DIR
constantGF_CLIENT_DIR
environment property.ArchivistUtils
deleted - duplicit toFileUtils
DeploymentContext
, but it has too many dependencies, so it is covered just by integration tests (persistence_all ie)The build locally passed:
I have read my own code now, it took me around 90 minutes. This is not a final state, there is several FIXMEs documenting discovered potential leaks which were too complicated for my brain and also they would need yet more radical changes. However this PR should improve the reliability+speed of GF a bit.