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

The history builtin may fail with "table is locked" #263

Closed
huiyiqun opened this issue Oct 12, 2016 · 4 comments
Closed

The history builtin may fail with "table is locked" #263

huiyiqun opened this issue Oct 12, 2016 · 4 comments
Labels

Comments

@huiyiqun
Copy link
Contributor

huiyiqun commented Oct 12, 2016

Run history repeatly, you may get following problem:

~> history
Exception: database table is locked: cmd
Traceback:
  [interactive], line 1:
    history

if you pipe the output to count, the probability the problem happens becomes higher.

@huiyiqun
Copy link
Contributor Author

@zhsj Use this instead for editor mode

~> $le:history 233
▶ 'ls -la'
~> each { put $@ } $le:history
▶ 'ls -la'

and maybe history builtin for script? @xiaq

~> elvish a.elv
Exception: variable $le:history not found
Traceback:
  [interactive], line 1:
    each { put $@ } $le:history
Exception: elvish exited with 1
Traceback:
  [interactive], line 1:
    elvish a.elv
~> cat a.elv
each { put $@ } $le:history

@huiyiqun
Copy link
Contributor Author

However, the builtin history is still dangerous for it will fail whenever the table is locked.

@xiaq xiaq added the bug label Oct 13, 2016
@xiaq
Copy link
Member

xiaq commented Oct 13, 2016

See: mattn/go-sqlite3#274

PS. Since this bug might indicate that we are using sqlite in a wrong way, I am not accepting the PR to remove history until this bug is fixed.

@xiaq xiaq changed the title history may fail sometimes The history builtin may fail with "table is locked" Oct 13, 2016
@xiaq
Copy link
Member

xiaq commented Oct 13, 2016

Also, with history | each { }, this happens virtually every time on my machine.

@xiaq xiaq closed this as completed in 89347df Oct 13, 2016
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