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

Is client safe for concurrency? #130

Closed
cjellick opened this issue Sep 8, 2017 · 1 comment
Closed

Is client safe for concurrency? #130

cjellick opened this issue Sep 8, 2017 · 1 comment

Comments

@cjellick
Copy link

cjellick commented Sep 8, 2017

In other words, can I use it safely from multiple goroutines?
Couldn't find this in the documentation anywhere.

@vetinari
Copy link
Contributor

There's a pending one (#112) which, once fixed, makes it safe to use but:

LDAP itself is asynchronous, which means you can send some requests (with ascending message id) and the responses are not guaranteed to return in that order.

The code receiving the response from the server ignores any id not sent by itself which means you could send request 1 from one go routine which takes a while to complete, then send the fast request 2 from a different go routine. The second one may be picked up by the first receiver and is discarded. See

func TestFinishMessage(t *testing.T) {
and example output https://travis-ci.org/go-ldap/ldap/jobs/227891683#L206 (the Received unexpected message lines).

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

3 participants