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

RocksDb Dispose stalls forever #68

Open
foresightyj opened this issue Aug 23, 2019 · 5 comments
Open

RocksDb Dispose stalls forever #68

foresightyj opened this issue Aug 23, 2019 · 5 comments

Comments

@foresightyj
Copy link

Attached screenshot shows that the program never gets out of the using statement.

image

@warrenfalk
Copy link
Owner

I did not reproduce this behavior. I created a new dotnet core application, installed RocksDbSharp and RocksDbNative (v6.2.2 of both). Typed in your example and ran it and it did exit.

image

Do you have any additional information you can provide?

Hanging on dispose like this is an indication that there is some sort of issue with the native interface which I have seen happen if it is loading an older version of the native library. (I.e. RocksDbSharp is 6.2.2 but the native dll that it loads is actually 5.4.x)

@foresightyj
Copy link
Author

foresightyj commented Aug 26, 2019

@warrenfalk

Here is my test project: TestRocksDb.zip. My computer is a Windows 7 machine.

I ran this project in another computer (Windows 2008 Server) and the result is the same. I also tried creating a dot net core project and the result is also the same.

Versions of both library are 6.2.2, and both computers have SSD.

Here I also upload the project including actual built assemblies (excluding packages folder which contains nuget packages).

TestRocksDb.zip

@foresightyj
Copy link
Author

foresightyj commented Aug 26, 2019

@warrenfalk

FYI. Version 5.17.2 works fine in my computer. I am going to use it for now.

@warrenfalk
Copy link
Owner

When I open the solution in the zip in Visual Studio and run it, I immediate get the error "Unable to locate rocksdb native library, either install it, or use RocksDbNative nuget package". This happens because there is no native dll under a runtimes folder in bin\Debug.

I believe this is true for you too, except in your environment RocksDbNative is finding an older version of the native dll elsewhere. As stated earlier, I believe that an older version can result in this hanging. So in my environment I get "unable to locate" and in your environment you get a hang.

If true, the real issue is that the native dll is not found, and if you open the solution in your zip and run it, you will not find a runtimes folder under bin\Debug folder that contains native dlls.

But if I delete the .vs folder in your zip and run it, it runs and exits fine with no error or hanging.

In .Net Framework, the management of native dlls has always been a little bit broken (this is fixed in dotnet core, where this doesn't happen). Who knows what Visual Studio is saving in that .vs folder, but I believe something went wrong the first time. I was also able to fix this issue simply by uninstalling RocksDbNative and then reinstalling it in the PackageManager console. YMMV with this. I am also using Visual Studio 2019 and I see you are using 2017.

@MGRussell
Copy link

MGRussell commented Apr 18, 2020

I had the exact same issue here, which feels like deadlock. I suspect the culprit may be the OS. Like the original poster, I am also using Windows 7.

I tested this in both a new .NET Framework forms project and a .NET Core console project. Dispose hung on both.

Definitely no older references as I've never installed anything related to rocks on this system before.


Expanding upon this. I just cloned the project. It hangs on the call to

Native.Instance.rocksdb_close(Handle);

In particular on the call to rocksdb_close(...)

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