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

Support multiple bucket open #56

Open
daschl opened this issue Jan 21, 2020 · 7 comments
Open

Support multiple bucket open #56

daschl opened this issue Jan 21, 2020 · 7 comments

Comments

@daschl
Copy link
Contributor

daschl commented Jan 21, 2020

The lcb run loop needs to keep track on N buckets (also taking into account GCCCP on the first one) and then also loop all of them for readiness. Also we need code in place that dispatches it to the right one

@daschl daschl added this to the 1.0.0-alpha.3 milestone Jan 21, 2020
@daschl daschl self-assigned this Jan 21, 2020
@brigand
Copy link

brigand commented May 20, 2020

I'm dealing with this issue currently. I guess the workaround is to spawn multiple processes. My use case is connecting to two clusters, and one bucket in each.

@daschl
Copy link
Contributor Author

daschl commented May 20, 2020

@brigand I fixed it on master, can you try if that works for you?

@brigand
Copy link

brigand commented May 20, 2020

I'm on the latest code from master, so maybe it's a separate issue with multiple clusters.

Using tokio=0.2, #[tokio::main], the latest stable compiler, brew install libcouchbase --head.

I unfortunately didn't commit the broken code, but this is the error from when I tried to connect to two clusters in one process.

thread '<unnamed>' panicked at 'called `Result::unwrap()` on an `Err` value: 1048', /Users/.../.cargo/git/checkouts/couchbase-rs-9bae2babc4d89f61/769b1dc/couchbase/src/io/lcb/mod.rs:86:20
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
thread '<unnamed>' panicked at 'attempt to subtract with overflow', /Users/.../.cargo/git/checkouts/couchbase-rs-9bae2babc4d89f61/769b1dc/couchbase/src/io/lcb/callbacks.rs:325:61
thread '[warn] event_base_loop: reentrant invocation.  Only one event_base_loop can run on each event_base at once.
tokio-runtime-worker' panicked at 'called `Result::unwrap()` on an `Err` value: Canceled', /Users/../.cargo/git/checkouts/couchbase-rs-9bae2babc4d89f61/769b1dc/couchbase/src/api/mod.rs:416:9

@daschl
Copy link
Contributor Author

daschl commented May 21, 2020

@brigand unfortunately I think brew install libcouchbase is installing lcb2, not lcb3 which is needed. this change has been closed but it needs to go again at some point: Homebrew/homebrew-core#49103

Note that it might be easier for you if you just use couchbase-rs with the libcouchbase-static feature enabled, then you don't need to care about the dependency .. or you just build it from source and install it

@daschl
Copy link
Contributor Author

daschl commented May 21, 2020

Actually, now that I read this again --head might install lcb3, but to be on the safe side can you try with static again? If it still fails is there a standalone prog you can provide so I can try to reproduce?

The callback attempt to subtract with overflow is weird but that looks like a real issue that I'll try to fix on master

@brigand
Copy link

brigand commented May 21, 2020

I think my connection to the couchbase server is actually the problem here, and it's just a bug with error reporting.

I was running it with a port-forwarding layer between the client and couchbase server, and it's likely doing something weird to the connection. Even with separate processes I get "A generic / unknown error happened" when talking to that instance, but the code works fine with a local instance of couchbase.

Likely a user error on my part.

@daschl
Copy link
Contributor Author

daschl commented May 22, 2020

@brigand we do not support running a proxy/port forwarding between client and server, and the reason is the client looks at a config it gets from the server, including ports - you'll just be running into issues down the road, please don't do it :)

w.r.t the actual issue, yeah, I think the unwraps need to be fixed and proper error reporting needs to be in place. I'll close this ticket then and will open a new one with your bootstrap diagnostics issue so we can track it properly.

@daschl daschl removed this from the 1.0.0-alpha.3 milestone Sep 11, 2020
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

2 participants