-
Notifications
You must be signed in to change notification settings - Fork 395
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: don't allow package version to be None
#1380
Conversation
thank you! |
hmm, when does this happen? |
@brettlangdon it was occurring in @thehesiod's case in a pretty niche situation where the version would be dd-trace-py/ddtrace/__init__.py Lines 14 to 18 in 14fb771
which would then be used here*: Line 156 in 14fb771
* edited to correct the line |
Makes sense, that is off scenario, but possible. aside: I wonder if we should default to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one question: the reason you were able to fix that headers issue is because the Exception
base class is not caught.
You're now hiding that bug under the carpet IIUC.
I don't see how it's wise?
If you want the writer thread to be robust to crash, you should handle a general try/except Exception
at its root that makes it restart on handled exception. Using except Exception
everywhere and hiding issues is not goint to help us in the long run.
@jd agreed. But you're proposing a larger refactoring change (which I totally agree with). This is correction to existing code that, from what I can tell, assumed that it was catching all possible exceptions that could be raised and it wasn't. Given the way the current code is structured I think it makes sense. I also don't like it either. A larger change to this code will take longer to review/get merged whereas this addresses the problem immediately without introducing any new "badness" that was not already there 馃槢. Exception code aside, I think it does make sense to change the default for version to be, at least, not Your thoughts? 馃檪 |
The problem is that I think the medicine is worse than the illness: this is not going to fix the illness, it's going to hide it, and worse, hide future ones! I'm not asking for a large refactoring. I'm stating the current behavior is sane. What should be fixed is:
|
Fair enough 馃檪. The real issue at hand here is that a header can be |
1cbb5b9
to
2cac68f
Compare
None
in general assuming what errors can occur from a global error handler is bad policy, especially w/o any sort of logging that errors are uncaught since it causes the thread to go away |
If users try to repackage the library there is the possibility that the
__version__
can beNone
which eventually causes the writer to fail as it tries to serializeNone
into the http headers sent to the agent.This PR provides a more sensible default.
thanks to @thehesiod for finding and describing this error 馃檪.