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

Investigate store-and-reraise exception pattern #1340

Closed
vxgmichel opened this issue Aug 3, 2020 · 0 comments · Fixed by #1438
Closed

Investigate store-and-reraise exception pattern #1340

vxgmichel opened this issue Aug 3, 2020 · 0 comments · Fixed by #1438
Assignees
Projects

Comments

@vxgmichel
Copy link
Contributor

vxgmichel commented Aug 3, 2020

In BackendAuthenticatedConn._acquire_transport, a previously-caught exception might be re-raised:

This can lead to traceback issues as shown in this very long trace:
https://sentry.io/organizations/scille/issues/1815651121/events/65fcd73102d8457d9bf678448be9df22/?project=1212848

Here's a way to reproduce the problem (credit goes to @touilleMan)

Python 3.6.9 (default, Nov  7 2019, 10:44:02)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> exc = None
>>> def foo(exc):
...   raise exc
...
>>> def bar(exc):
...   foo(exc)
...
>>> bar(RuntimeError("1"))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
RuntimeError: 1
>>> try:
...   bar(RuntimeError("2"))
... except BaseException as _exc:
...   exc = _exc
...
>>> exc
RuntimeError('2',)
>>> bar(exc)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
  File "<stdin>", line 2, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
RuntimeError: 2
>>> bar(exc)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
  File "<stdin>", line 2, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
RuntimeError: 2
>>> bar(exc)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
  File "<stdin>", line 2, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
RuntimeError: 2
>>> bar(exc)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
  File "<stdin>", line 2, in <module>
  File "<stdin>", line 2, in bar
  File "<stdin>", line 2, in foo
RuntimeError: 2
>>>
@stefan-contiu stefan-contiu added this to New comers in Dev Board Aug 26, 2020
@touilleMan touilleMan moved this from New comers to Ready in Dev Board Aug 26, 2020
@vxgmichel vxgmichel moved this from Ready to Doing in Dev Board Sep 9, 2020
vxgmichel added a commit that referenced this issue Sep 9, 2020
@Max-7 Max-7 moved this from Doing to Done in Dev Board Sep 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Dev Board
To review
1 participant