Title: ldap.TIMEOUT unhandled in ReconnectLDAPObject _apply_method_s · Issue #446 · python-ldap/python-ldap · GitHub
Open Graph Title: ldap.TIMEOUT unhandled in ReconnectLDAPObject _apply_method_s · Issue #446 · python-ldap/python-ldap
X Title: ldap.TIMEOUT unhandled in ReconnectLDAPObject _apply_method_s · Issue #446 · python-ldap/python-ldap
Description: Issue description: When using ReconnectLDAPObject, if a server disconnects after a connection is created, it fails with an ldap.TIMEOUT which is unhandled. ldap.TIMEOUT is properly caught only during the initial connection, whereas in _a...
Open Graph Description: Issue description: When using ReconnectLDAPObject, if a server disconnects after a connection is created, it fails with an ldap.TIMEOUT which is unhandled. ldap.TIMEOUT is properly caught only duri...
X Description: Issue description: When using ReconnectLDAPObject, if a server disconnects after a connection is created, it fails with an ldap.TIMEOUT which is unhandled. ldap.TIMEOUT is properly caught only duri...
Opengraph URL: https://github.com/python-ldap/python-ldap/issues/446
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ldap.TIMEOUT unhandled in ReconnectLDAPObject _apply_method_s","articleBody":"Issue description:\r\n\r\nWhen using ReconnectLDAPObject, if a server disconnects after a connection is created, it fails with an ldap.TIMEOUT which is unhandled.\r\n\r\nldap.TIMEOUT is properly caught only during the initial connection, whereas in _apply_method_s which is applied to synchronous methods, ReconnectLDAPObject only catches the ldap.SERVER_DOWN exception.\r\n\r\nSteps to reproduce: \r\n\r\nTo reproduce the issue, I created the following script to test. I created an interface with the additional 192.168.1.100 address, which I remove after initializing the ReconnectLDAPObject and binding.\r\n\r\n```\r\nimport ldap\r\n#from ldappool import StateConnector as Connector\r\n#from ldap.ldapobject import SimpleLDAPObject as Connector\r\nfrom ldap.ldapobject import ReconnectLDAPObject as Connector\r\nfrom time import sleep\r\n\r\nldap.set_option(ldap.OPT_NETWORK_TIMEOUT, 10)\r\n\r\nc = Connector('ldap://192.168.1.100,ldap://localhost')\r\nc.network_timeout = 10\r\nc.timeout = 10\r\nc.simple_bind_s()\r\nprint('sleeping...')\r\nsleep(30) # now remove the 192.168.1.100 IP address from the interface\r\nprint('awoke')\r\n\r\nresult = c.search_s(\r\n 'ou=Users,dc=openstack,dc=org',\r\n 1,\r\n '(\u0026(objectClass=inetOrgPerson)(uid=*))',\r\n ['mail', 'userPassword', 'description', 'enabled', 'uid', 'cn'],\r\n 0\r\n)\r\nprint(result)\r\n```\r\n\r\n```\r\nTraceback (most recent call last): \r\n File \"/home/ubuntu/devstack/test.py\", line 18, in \u003cmodule\u003e \r\n result = c.search_s( \r\n File \"/usr/local/lib/python3.9/dist-packages/ldap/ldapobject.py\", line 631, in search_s \r\n return self.search_ext_s(base,scope,filterstr,attrlist,attrsonly,None,None,timeout=self.timeout)\r\n File \"/usr/local/lib/python3.9/dist-packages/ldap/ldapobject.py\", line 1030, in search_ext_s \r\n return self._apply_method_s(SimpleLDAPObject.search_ext_s,*args,**kwargs) \r\n File \"/usr/local/lib/python3.9/dist-packages/ldap/ldapobject.py\", line 968, in _apply_method_s \r\n return func(self,*args,**kwargs) \r\n File \"/usr/local/lib/python3.9/dist-packages/ldap/ldapobject.py\", line 625, in search_ext_s\r\n return self.result(msgid,all=1,timeout=timeout)[1] \r\n File \"/usr/local/lib/python3.9/dist-packages/ldap/ldapobject.py\", line 535, in result \r\n resp_type, resp_data, resp_msgid = self.result2(msgid,all,timeout) \r\n File \"/usr/local/lib/python3.9/dist-packages/ldap/ldapobject.py\", line 539, in result2 \r\n resp_type, resp_data, resp_msgid, resp_ctrls = self.result3(msgid,all,timeout) \r\n File \"/usr/local/lib/python3.9/dist-packages/ldap/ldapobject.py\", line 543, in result3\r\n resp_type, resp_data, resp_msgid, decoded_resp_ctrls, retoid, retval = self.result4(\r\n File \"/usr/local/lib/python3.9/dist-packages/ldap/ldapobject.py\", line 553, in result4\r\n ldap_result = self._ldap_call(self._l.result4,msgid,all,timeout,add_ctrls,add_intermediates,add_extop)\r\n File \"/usr/local/lib/python3.9/dist-packages/ldap/ldapobject.py\", line 128, in _ldap_call\r\n result = func(*args,**kwargs) \r\nldap.TIMEOUT \r\n```\r\n\r\nOperating system: \r\n\r\nGNU Linux Ubuntu 21.04\r\n\r\nPython version: \r\n\r\nPython 3.9.5\r\n\r\npython-ldap version: \r\n\r\n3.4.0\r\n","author":{"url":"https://github.com/xek","@type":"Person","name":"xek"},"datePublished":"2021-12-08T15:56:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/446/python-ldap/issues/446"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fcadad47-2c2f-6177-ab40-425b72f16105 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8CC6:14F335:6C8F876:8D1C316:697574C3 |
| html-safe-nonce | e791aefc5aff82f5a67013ee01bd3ec6cea75138a27207a9a8f5521873912842 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4Q0M2OjE0RjMzNTo2QzhGODc2OjhEMUMzMTY6Njk3NTc0QzMiLCJ2aXNpdG9yX2lkIjoiNTYzNTExNDUyMTg4OTcwOTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 660bd6485d9802c1395247532259c07beed6c56a8d624d8d5fd5e6ab9c6c7248 |
| hovercard-subject-tag | issue:1074562395 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python-ldap/python-ldap/446/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fe9dd2c840cbac6d320068977cc020ea2b117527045f7e5b1b02ceda60a46b8b/python-ldap/python-ldap/issues/446 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fe9dd2c840cbac6d320068977cc020ea2b117527045f7e5b1b02ceda60a46b8b/python-ldap/python-ldap/issues/446 |
| og:image:alt | Issue description: When using ReconnectLDAPObject, if a server disconnects after a connection is created, it fails with an ldap.TIMEOUT which is unhandled. ldap.TIMEOUT is properly caught only duri... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | xek |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4a4bf5f4e28041a9d2e5c107d7d20b78b4294ba261cab243b28167c16a623a1f |
| turbo-cache-control | no-preview |
| go-import | github.com/python-ldap/python-ldap git https://github.com/python-ldap/python-ldap.git |
| octolytics-dimension-user_id | 33895877 |
| octolytics-dimension-user_login | python-ldap |
| octolytics-dimension-repository_id | 111794776 |
| octolytics-dimension-repository_nwo | python-ldap/python-ldap |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 111794776 |
| octolytics-dimension-repository_network_root_nwo | python-ldap/python-ldap |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 488b30e96dfd057fbbe44c6665ccbc030b729dde |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width