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

Directories in profiles are not deleted #561

Closed
JanVomlel opened this issue Jan 14, 2021 · 4 comments
Closed

Directories in profiles are not deleted #561

JanVomlel opened this issue Jan 14, 2021 · 4 comments
Labels
ToExplore Label for internal use only

Comments

@JanVomlel
Copy link

When I run any droid command for example:

droid.bat -a "c:\yyy" -p "c:\zzz.droid" -R

In directory C:\Users\xxx.droid6\profiles is created new directory.

In droid 6.4 this directory is deleted when command finishes, but in 6.5 it is not deleted. Every command causes new directory creation.

.droid/droid.properties are default and contains:

development_mode = false
@nishihatapalmer
Copy link
Contributor

Confirmed this happens using the Windows-only DROID 6.5 with embedded java version, on Win 10.
Tried on Windows 10 with Oracle Java 8 installed, using the all platforms version, and also does not delete.

Works correctly on Linux using the all platforms version, using openjdk 11.

So looks like something to do with running this code on Windows, not the version of the code itself or the version of Java. The code itself that performs the deletion doesn't appear to have changed for 6.5.

I don't currently have a dev environment set up in Windows to debug this currently, so looking for someone else to step through the ProfileManagerImp.closeProfile() method and see what's happening under Windows.

@CaptainBrad CaptainBrad added the ToExplore Label for internal use only label Jan 13, 2023
@sparkhi
Copy link
Collaborator

sparkhi commented Jan 12, 2024

it looks like closing the profile does not release references to the files in the derby database. The reference is released only when the Java process is terminated (i.e. Droid is shutdown) hence the files cannot be deleted. The error says the "files are being accessed".
Also, I think, if there are any files within that profile that are encountered before the derby database, they would be successfully deleted, which could leave the profile in an unknown state.
In my trials, the derby db deletion was one of the first ones but I don't know whether that order is guaranteed

@nishihatapalmer
Copy link
Contributor

It would make sense the difference between Linux and windows here. Linux files can be deleted even if something has a file reference open, windows file system does not allow it.

@sparkhi
Copy link
Collaborator

sparkhi commented Jan 12, 2024

Thanks Matt 👍🏼
My suspicion is, the derby driver might have changed rather than something within the droid code, I'll take a look to see if there is something that needs to be done to explicitly clear file reference in derby.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ToExplore Label for internal use only
Projects
Status: Done
Development

No branches or pull requests

4 participants