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

Dolt CLI locks table export file for a longer while #2557

Closed
Vectorial1024 opened this issue Jan 4, 2022 · 8 comments
Closed

Dolt CLI locks table export file for a longer while #2557

Vectorial1024 opened this issue Jan 4, 2022 · 8 comments
Assignees

Comments

@Vectorial1024
Copy link

Let's say:

  • I have some tables in my dolt database repo
  • The tables already have some data
  • I want to edit the data in local, so I already cloned the repo using dolt cli

(I am in Windows 10 btw)

Now I want to export the data into csv for further editing. Following the blog entries, I open a new cmd and do

> dolt table export [table_name] test.csv
Successfully exported data.

This looks good. I can see the file, the file contains something.

However, when I try to immediately edit it, the test.csv file is locked. I cannot edit it.

Exiting the cmd instance or waiting for a few minutes seem to let the cli release the lock.


The affected dolt cli version:

> dolt version
dolt version 0.35.0
@timsehn
Copy link
Sponsor Contributor

timsehn commented Jan 4, 2022

Nice. A windows bug. @Hydrocharged or @zachmu ?

@Vectorial1024
Copy link
Author

Update: I can't seem to pin down whether it is locking for a few minutes or just keeps locking it. One of my earlier try is still locking up right until now. It has been about 30 mins since the data was exported.

@Hydrocharged
Copy link
Contributor

I'll look into this and see what's going on here.

@Hydrocharged Hydrocharged self-assigned this Jan 5, 2022
@Hydrocharged
Copy link
Contributor

@Vectorial1024 I can't reproduce this, nor can I see anything that would be causing your issue, at least on the common logic path. Your issue seems to be a symptom of Dolt not properly exiting, and hanging on to a file handle, but that's just a guess. It may be something specific to what you're outputting, such as a specific MySQL type that is misbehaving, or perhaps Dolt does not play well with your terminal and hangs for some reason.

Terminals: Command Prompt, WSL, MinTTY
Text Editors: Notepad, Notepad++, Visual Studio Code

I tried every combination of the above listed terminals and text editors, along with different Dolt versions, both older and newer than your listed version of 0.35.0. Would it be possible to make a minimal repro that you could share? Along with which terminals and text editor you're using? I assume you're using the Command Prompt since you said cmd, but I'd like to confirm that. Also, I don't think the text editor should matter, but I just want to isolate as many variables as possible.

@Vectorial1024
Copy link
Author

It was a few days, and I roughly recall I was using the PowerShell (blue background) to export tables. But then it seemed moments later I switched to the Windows cmd (black background) to also try out table exporting...

While I was exporting tables I had VS Code open (I forgot whether I had the destination file open as well). The VS Code was equipped with a csv editing extension called "Edit CSV". A couple of steps later (I cant recall what steps), and I noticed that VS Code can't save data to the destination file, and dolthub from either one of PowerShell/cmd also cannot save data to the destination file.

One thing to note, I remember that night when I tried to switch off Windows, it says an instance of dolthub is still open and Windows cannot shut down. So yeah your suspicion of "not exiting properly" is right on point.

@Hydrocharged
Copy link
Contributor

Downloaded the "Edit CSV" extension and attempted to reproduce again in Powershell and Command Prompt and I still did not encounter any error.

My last guess would be that there's something with your specific dataset, or with how your repository is configured, that is causing the issue. Is it possible to create a repository on your side that recreates the issue that you can then upload and share with me?

@Vectorial1024
Copy link
Author

I somehow cannot reproduce this on my side. But one thing I could point out is that my testing dolt database contained Chinese characters, not sure if it contributed anything to the lock...

Perhaps it is best to close this? Since this is basically cold case, and I have no idea how to repor it anymore.

@timsehn
Copy link
Sponsor Contributor

timsehn commented Jan 19, 2022

Let's close.

Thanks for cooperating. We'll be on the lookout for something similar.

Please don't hesitate to open issues if you find any problems.

@timsehn timsehn closed this as completed Jan 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants