-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
ERROR: resource temporarily unavailable for all keys operations using CLI after REST server is started #1255
Comments
Thanks for reporting. Do you have a real use case for needing this? If you're running the REST server already, can't you use those endpoints? I think we might just not support this for now unless there's a very compelling reason to. |
At least we should change the error message to indicate what the problem is. We can for sure do that :) |
I was getting the exact same error when implementing a go levelDB. leveldb will return "resource temporarily unavailable" if you have two routines trying to access the db. If this is the error it can be fixed by inserting db.Close() at the end of the functions accessing the db. not sure if the REST server is even using leveldb , but I thought I'd add it since I saw the exact same error |
Can confirm that this error still exists and that while running the REST-server it will return:
However the problem is, that the REST endpoint doesn't seem to work either. When using it like /keys/create?name=cosmos&password=cosmos
So you can't use the REST endpoints to create keys while running the REST server. It also seems that all (or at least most) REST endpoints that use POST are not working correctly. |
@fkbenjamin these are all the key endpoints I'm aware of (I'm also aware some of the docs are invalid/outdated): func RegisterRoutes(r *mux.Router) {
r.HandleFunc("/keys", QueryKeysRequestHandler).Methods("GET")
r.HandleFunc("/keys", AddNewKeyRequestHandler).Methods("POST")
r.HandleFunc("/keys/seed", SeedRequestHandler).Methods("GET")
r.HandleFunc("/keys/{name}", GetKeyRequestHandler).Methods("GET")
r.HandleFunc("/keys/{name}", UpdateKeyRequestHandler).Methods("PUT")
r.HandleFunc("/keys/{name}", DeleteKeyRequestHandler).Methods("DELETE")
} I was successfully able to create a key on the latest |
@alexanderbez Thx for that info! Was able to create a key using your info... I was looking at the docs for |
This behavior is currently expected, since the open database is locked - if this is a problem for clients, I guess we can close the DB after every operation, the speed penalty doesn't matter much. |
The same error occurs if we try to run 2 parallel commands in CLI. I have few bash scripts for monitoring and they conflicts with each other due to "ERROR: resource temporarily unavailable" |
IMHO, we can expose the file opening option for level db in tendermint/libs/db/go_level_db.go
so that the caller in cosmos can pass
@kwunyeung But this still blocks us pressure testing in large scale. Do you have any suggestions or can point doc to me how tendermint / cosmos do the performance test to see the highest transaction per seconds can be achieved? Thanks a lot! |
@ackratos This is a good fix! Would you feel comfortable putting up a PR with a fix? |
Thanks, I'd like to raise a PR for fixing today |
@ackratos Did you get a chance to write that code 🙏 Would love to get this merged and fix this issue! |
blocked a bit yesterday for daily job... Will working on it now, sorry |
@ackratos Totally know how that goes! Thank you for contributing! |
…r parallelization between gaiacli
After starting REST server with
gaiacli advanced rest-server
, all operations withgaiacli keys
will give this error.ERROR: resource temporarily unavailable
Stop the REST server and those operations work using CLI again. This doesn't happen for other modules.
The text was updated successfully, but these errors were encountered: