Skip to content

Conversation

beniwohli
Copy link
Contributor

@beniwohli beniwohli commented Nov 27, 2017

This aligns the Python agent to agents in other languages

This PR also simplifies the logic for sending data, and
uses a test server instead of mocks for many tests

@beniwohli beniwohli force-pushed the feature/server-config-rename branch from 066086c to 6c32323 Compare November 27, 2017 19:04
This aligns the Python agent to agents in other languages

This PR also simplifies the logic for sending data, and
uses a test server instead of mocks for many tests
@beniwohli beniwohli force-pushed the feature/server-config-rename branch from 6c32323 to 480fea9 Compare November 29, 2017 18:53
for processor in self.processors:
transaction = processor(self, transaction)
transactions.append(transaction)
if self.instrumentation_store:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this if is related to one of the subtle bugs you mentioned? isn't possible to init instrumentation_store to something not None?, like eg. in a way that if you can get_all() on it you get an empty list...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem here was if we had a configuration error, we would bail out early in __init__, before the instrumentation_store attribute was even set. Then when we try to collect transactions, the code explodes. Due to mocking, that code path was never hit in tests.

I don't think it's worth the effort to initialize the instrumentation_store to a DummyStore or somesuch, only to change it to the real store a few lines down (if the config validates), tbh.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i see, makes sense. thanks!

for url, transport in self._transports.items():
for url, transport in list(self._transports.items()):
transport.close()
self._transports.pop(url)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm good find! (i think...) 😁

@beniwohli beniwohli closed this in c3b9c46 Nov 30, 2017
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

Successfully merging this pull request may close these issues.

2 participants