Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
Already on GitHub? Sign in to your account
http txns: Do not cache error responses #1913
+11
−3
Conversation
Kegsay
added
the
bug
label
Feb 13, 2017
Kegsay
assigned
erikjohnston
Feb 13, 2017
| + # (a Twisted failure), remove it from the transaction map. | ||
| + # This is done to ensure that we don't cache rate-limiting errors, etc. | ||
| + res = observable.get_result() | ||
| + if res.value.code >= 300: |
erikjohnston
Feb 13, 2017
Owner
Not all errors have a .code. Usually we do this sort of thing by adding an errBack to the deferred to remove the entry from the cache
Kegsay
Feb 13, 2017
Contributor
What should I do to check if there is a code attribute? Try to cast to CodeMessageException?
| + # from the transaction map. This is done to ensure that we don't | ||
| + # cache transient errors like rate-limiting errors, etc. | ||
| + def remove_from_map(err): | ||
| + del self.transactions[txn_key] |
erikjohnston
Feb 13, 2017
Owner
I'd actually do this as self.transactions.pop(txn_key, None) just in case the txn has already been deleted somehow. (del will throw if it doesn't exsit)
Kegsay
added some commits
Feb 13, 2017
|
@erikjohnston PTAL |
erikjohnston
merged commit 359c97f
into
develop
Feb 13, 2017
7 of 8 checks passed
Sytest Dendron (Commit)
Build #1520 origin/kegan/dont-cache-errors failed in 1 min 23 sec
Details
Sytest Dendron (Merged PR)
Build finished.
Details
Sytest Postgres (Commit)
Build #2339 origin/kegan/dont-cache-errors succeeded in 7 min 22 sec
Details
Sytest Postgres (Merged PR)
Build finished.
Details
Sytest SQLite (Commit)
Build #2406 origin/kegan/dont-cache-errors succeeded in 5 min 26 sec
Details
Sytest SQLite (Merged PR)
Build finished.
Details
continuous-integration/travis-ci/pr
The Travis CI build passed
Details
continuous-integration/travis-ci/push
The Travis CI build passed
Details
erikjohnston
added a commit
that referenced
this pull request
Mar 13, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Kegsay commentedFeb 13, 2017
Previously we did. This meant that, amongst other errors, rate-limiting errors
would be cached and prevent messages with that txn ID being sent.