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

Locked databases #17

Closed
xyproto opened this issue Oct 10, 2017 · 5 comments
Closed

Locked databases #17

xyproto opened this issue Oct 10, 2017 · 5 comments

Comments

@xyproto
Copy link

xyproto commented Oct 10, 2017

Hi,

First of all, thanks for creating boltbrowser, it's the shit. 👍

When creating a database with algernon, with the following command:

algernon -t --boltdb test.db . :7777

And then closing the web server by typing exit or pressing ctrl-d, accessing the database with boltbrowser works fine:

boltbrowser test.db

Adding keys and values (on the Algernon Lua prompt) and then examining them in boltbrowser (after exiting the webserver) also works great:

kv = KeyValue("pageviews")
kv:set("counter", 9999)

However, if accessing the database while the web server is running, there is no error message and no timeout and the console interface just goes into black and hangs (can't be closed with esc, q or ctrl-c), until the web server has quit and released the lock on the database.

This is a feature request for adding a timeout and/or a way to exit boltbrowser when the database is locked. Ignoring the database lock and entering some sort of read-only mode would also be interesting, if possible.

Cheers,
Alexander F Rødseth

@br0xen
Copy link
Owner

br0xen commented Oct 10, 2017

I'm glad you like it!
I went ahead and added a new issue to timeout and allow exiting boltbrowser if the database is locked (with the 'hacktoberfest' tag, even, so maybe someone else will issue a pull request).

As for opening the DB in a read-only mode, I'm going to have to do some research into that and see what I can come up with.

Thanks!

@br0xen
Copy link
Owner

br0xen commented Oct 24, 2018

This issue has been resolved for a while, I just forgot to close it.

@br0xen br0xen closed this as completed Oct 24, 2018
@xyproto
Copy link
Author

xyproto commented Oct 24, 2018

When trying the steps to reproduce the issue, the terminal still hangs, but there is this output:

���������������������������������

This is with konsole and TERM=konsole-256color.

Neither ctrl-c nor ctrl-\ quits the program.

When setting TERM=vt100, boltbrowser still hangs, but I get this output:

$<50>

I used this command to build and install boltbrowser:

go get -u github.com/br0xen/boltbrowser

Using Go 1.11, on 64-bit Arch Linux.

@br0xen
Copy link
Owner

br0xen commented Oct 24, 2018

Does it still work if the web server isn't running? Or are you getting garbage on the display regardless of if the DB is locked?

@br0xen
Copy link
Owner

br0xen commented Oct 24, 2018

By the way, people have generally had more luck with boltbrowser using a console type of xterm-256color, though in my testing (with konsole) konsole-256color works fine too, so I'm not sure why you were getting some garbled output up there.

I tested a locked database with the newest commit and, by default, it'll timeout trying to connect after a second.

backwardn pushed a commit to backwardn/boltbrowser that referenced this issue Oct 2, 2019
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

2 participants