-
Notifications
You must be signed in to change notification settings - Fork 57
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
Netbeans hangs when it exits. #344
Comments
Repeat on other projects failed. |
This is the shutdown hook trying to save the configurations. If you look at that method in the sources, it does nothing fancy but reads the config file from the disk. So, it means that the file system does not answer for some reason (or is slow for something, maybe a slow network drive?). Though I don't think I can fix this problem but I might mitigate it by being less aggressive when saving the configurations. I will see if there is anything I can do about that. |
It is possible that something is keeping this file open for writing and the read waits for new writes. What OS are you using? |
OS windows 7, x64 |
I seriously doubt that it is the content of the file, you may look at NbFileUtils.tryGetLineSeparatorForTextFile but it really just loops over a file stream, there is no compicated parsing here. If anything, then it was the location or that it was open for writting (with shared read). |
Perhaps the method (tryGetLineSeparatorForTextFile) contains an eternal
loop.
int readCount = input.read(buffer);
while (readCount > 0) {
...
input.read(buffer);
}
14 июля 2017 г. 1:47 пользователь "Attila Kelemen" <notifications@github.com>
написал:
… This is the shutdown hook trying to save the configurations.
If you look at that method in the sources, it does nothing fancy but reads
the config file from the disk. So, it means that the file system does not
answer for some reason (or is slow for something, maybe a slow network
drive?).
Though I don't think I can fix this problem but I might mitigate it by
being less aggressive when saving the configurations. I will see if there
is anything I can do about that.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#344 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AK5M_yFXAdvTqk_wRbp0NNYjgyXGFZJ_ks5sNoJfgaJpZM4OWmNf>
.
|
That would mean, that |
The readCount variable is set before the loop, it does not change in the
body of the loop.
If more than 0 bytes are read from the file, the condition in "while
(readCount> 0)" will always be true.
https://github.com/kelemen/netbeans-gradle-project/blob/v1.4.1/netbeans-gradle-plugin/src/main/java/org/netbeans/gradle/project/util/NbFileUtils.java#L43-L80
At the end of the cycle, "input.read (buffer)" is written. Probably it is
necessary "readCount = input.read (buffer)"
16 июля 2017 г. 16:00 пользователь "Attila Kelemen" <
notifications@github.com> написал:
… That would mean, that Files.newInputStream(file) (which is a core JDK
method) returns an infinitely long file stream. Given that there are no
infinitely long files, I doubt that, because that would be a huge bug in
the JDK.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#344 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AK5M_xRUaKQsIrza9XdQVa7D64f-SPT1ks5sOe05gaJpZM4OWmNf>
.
|
Thanks, I didn't even notice that the second read fails to set the |
I have released a new version containing the fix of this bug. You can wait for it to be available in the plugins menu or install it manually (for the NB Plugin Portal page or from the releases page of GitHub). |
Netbeans hangs when it exits.
In the tryGetLineSeparatorForTextFile method from the class java.org.netbeans.gradle.project.util.NbFileUtils.
It helps to delete files "gradle-app.setting" ".nb-gradle-properties" and folder ".nb-gradle"
The text was updated successfully, but these errors were encountered: