Skip to content
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

Closed
PavelSann opened this issue Jul 13, 2017 · 10 comments
Closed

Netbeans hangs when it exits. #344

PavelSann opened this issue Jul 13, 2017 · 10 comments
Labels

Comments

@PavelSann
Copy link

Netbeans hangs when it exits.
In the tryGetLineSeparatorForTextFile method from the class java.org.netbeans.gradle.project.util.NbFileUtils.

1

It helps to delete files "gradle-app.setting" ".nb-gradle-properties" and folder ".nb-gradle"

@PavelSann
Copy link
Author

Repeat on other projects failed.
Perhaps the configuration files were from the old version or damaged.

@kelemen
Copy link
Owner

kelemen commented Jul 13, 2017

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.

@kelemen
Copy link
Owner

kelemen commented Jul 13, 2017

It is possible that something is keeping this file open for writing and the read waits for new writes. What OS are you using?

@PavelSann
Copy link
Author

OS windows 7, x64
The problem was repeated all the time, but only on one of the projects. I think it was the file that was to blame.
I'm sorry I did not save it for tests.

@kelemen
Copy link
Owner

kelemen commented Jul 14, 2017

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).

@PavelSann
Copy link
Author

PavelSann commented Jul 16, 2017 via email

@kelemen
Copy link
Owner

kelemen commented Jul 16, 2017

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.

@PavelSann
Copy link
Author

PavelSann commented Jul 16, 2017 via email

@kelemen
Copy link
Owner

kelemen commented Jul 16, 2017

Thanks, I didn't even notice that the second read fails to set the readCount. I guess noone noticed this bug simply because the first line should always be shorter than 8 kB. This bug actually prevents saving settings until you close NB. I will fix it and will have a new release (fixing another bug).

@kelemen
Copy link
Owner

kelemen commented Jul 16, 2017

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).

@kelemen kelemen closed this as completed Jul 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants