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

how to disable 'Resource temporarily unavailable'? #904

Open
Freed-Wu opened this issue Jun 24, 2024 · 7 comments
Open

how to disable 'Resource temporarily unavailable'? #904

Freed-Wu opened this issue Jun 24, 2024 · 7 comments

Comments

@Freed-Wu
Copy link
Contributor

Is your feature request related to a problem? Please describe.

I try to create many rime sessions with a same rime config. However, it will give me

E20240624 15:45:10.494415 137926437325056 level_db.cc:259] Error opening db 'luna_pinyin': IO error: lock .../rime/luna_pinyin.userdb/LOCK: Resource temporarily unavailable

It will not effect it work. I still want to know how to disable it.

Describe the solution you'd like
Disable this error

Describe alternatives you've considered
Decrease the error to warning or info.

@fxliang
Copy link
Contributor

fxliang commented Jun 24, 2024

Maybe you should review your code on how you create sessions. I tested creating 101 sessions in a loop but got no errors.

@ksqsf
Copy link
Member

ksqsf commented Jun 24, 2024

LevelDB does not support concurrent Read and Write. If a session has opened it for writing, there's no way for other sessions to access it.

If you want to disable it, put enable_user_dict: false in your schema.

@Freed-Wu
Copy link
Contributor Author

enable_user_dict: false

Disable it in *.custom.yaml? What is the side effect?

@ksqsf
Copy link
Member

ksqsf commented Jun 25, 2024

luna_pinyin.custom.yaml:

patch:
  translator/enable_user_dict: false

The side effect is that there won't be any user words, because you don't read it at all.

@Freed-Wu
Copy link
Contributor Author

I set min_log_level to 3 to disable the error message. rime will printf any error message, it will disturb some programs' normal output.

  1. Except modify min_log_level, is there any method to silent error message?
  2. Or downgrade the message of levelDB from error to warning?

@ksqsf
Copy link
Member

ksqsf commented Jul 19, 2024

uh, I think I understand you now. You just want to suppress the error message.

it will disturb some programs' normal output

Are you using Rime in a TUI program? In that case, please refer to #799 . (i.e. building librime >= 1.10 in release mode should help.)

@Freed-Wu
Copy link
Contributor Author

You just want to suppress the error message.

Yes, sorry for my bad expression 😢

Are you using Rime in a TUI program

I try to use rime in zsh (this zsh plugin) and neovim (this vim plugin and that)
I have to set min_log_level to 3 to disable the error message.

building librime >= 1.10 in release mode should help

I use rime 1.11.2. It still give me the error message if I don't set min_log_level = 3:

screen-2024-07-19-16-42-39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants