{"action":"created","issue":{"url":"https://api.github.com/repos/go-ldap/ldap/issues/197","repository_url":"https://api.github.com/repos/go-ldap/ldap","labels_url":"https://api.github.com/repos/go-ldap/ldap/issues/197/labels{/name}","comments_url":"https://api.github.com/repos/go-ldap/ldap/issues/197/comments","events_url":"https://api.github.com/repos/go-ldap/ldap/issues/197/events","html_url":"https://github.com/go-ldap/ldap/issues/197","id":384448706,"node_id":"MDU6SXNzdWUzODQ0NDg3MDY=","number":197,"title":"Auto-(re)connect/bind on connection network errors","user":{"login":"emsearcy","id":1682693,"node_id":"MDQ6VXNlcjE2ODI2OTM=","avatar_url":"https://avatars3.githubusercontent.com/u/1682693?v=4","gravatar_id":"","url":"https://api.github.com/users/emsearcy","html_url":"https://github.com/emsearcy","followers_url":"https://api.github.com/users/emsearcy/followers","following_url":"https://api.github.com/users/emsearcy/following{/other_user}","gists_url":"https://api.github.com/users/emsearcy/gists{/gist_id}","starred_url":"https://api.github.com/users/emsearcy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emsearcy/subscriptions","organizations_url":"https://api.github.com/users/emsearcy/orgs","repos_url":"https://api.github.com/users/emsearcy/repos","events_url":"https://api.github.com/users/emsearcy/events{/privacy}","received_events_url":"https://api.github.com/users/emsearcy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-26T18:07:33Z","updated_at":"2018-12-14T17:17:24Z","closed_at":null,"author_association":"NONE","body":"As an alternative to #47, I think it would be useful for long-running services if there was a feature for the LDAP connection to attempt to re-connect/bind on connection errors, similar to how database/sql  maintains connections.\r\n\r\nHowever, unlike database/sql and #47, I don't think that LDAP actually needs pooling, because one LDAP connection can handle multiple asynchronous requests."},"comment":{"url":"https://api.github.com/repos/go-ldap/ldap/issues/comments/447391604","html_url":"https://github.com/go-ldap/ldap/issues/197#issuecomment-447391604","issue_url":"https://api.github.com/repos/go-ldap/ldap/issues/197","id":447391604,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NzM5MTYwNA==","user":{"login":"emsearcy","id":1682693,"node_id":"MDQ6VXNlcjE2ODI2OTM=","avatar_url":"https://avatars3.githubusercontent.com/u/1682693?v=4","gravatar_id":"","url":"https://api.github.com/users/emsearcy","html_url":"https://github.com/emsearcy","followers_url":"https://api.github.com/users/emsearcy/followers","following_url":"https://api.github.com/users/emsearcy/following{/other_user}","gists_url":"https://api.github.com/users/emsearcy/gists{/gist_id}","starred_url":"https://api.github.com/users/emsearcy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emsearcy/subscriptions","organizations_url":"https://api.github.com/users/emsearcy/orgs","repos_url":"https://api.github.com/users/emsearcy/repos","events_url":"https://api.github.com/users/emsearcy/events{/privacy}","received_events_url":"https://api.github.com/users/emsearcy/received_events","type":"User","site_admin":false},"created_at":"2018-12-14T17:17:24Z","updated_at":"2018-12-14T17:17:24Z","author_association":"NONE","body":"As a workaround, you can put your LDAP search/modify/etc in a loop (I'm using a max-retry counter to avoid an infinite loop), and escape out of the loop on success, on a non-network error. on a network error, attempt to re-bind (I also escape out of the loop if this happens) and loop.\r\n\r\nI think binding may not be concurrency-safe, so you have to protect that appropriately.\r\n\r\n(Oh, and to test for a network error, use ldap.IsErrorWithCode(err, 200))"}}
{"actor":{"display_login":"emsearcy"}}