forked from talkiq/gcloud-aio
-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] master from talkiq:master #248
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Clean up our general approach to logging: * include an `exc_message` extra wherever an exception is relevant to the log, to allow for message-level aggregation (eg. grouping errors by raised exception) * avoid using string templates in exception messages, to make aggregation easier (`message` is always a constant string for any given error case, so it can be alerted on) * downgrade application callback exceptions to a warning, since that can be a normal part of user flows -- if users want it logged at the error level, they can always do that themselves, we shouldn't be enforcing it
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
updates: - https://github.com/asottile/reorder_python_imports → https://github.com/asottile/reorder-python-imports - [github.com/pre-commit/mirrors-mypy: v1.14.1 → v1.15.0](pre-commit/mirrors-mypy@v1.14.1...v1.15.0) - https://github.com/pre-commit/mirrors-autopep8 → https://github.com/hhatto/autopep8 - [github.com/hhatto/autopep8: v2.0.4 → v2.3.2](hhatto/autopep8@v2.0.4...v2.3.2) - [github.com/python-jsonschema/check-jsonschema: 0.31.0 → 0.31.3](python-jsonschema/check-jsonschema@0.31.0...0.31.3) Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
We have seen unhandled exceptions making their way to the root unhandled
exception handler of the event loop in our application that uses pubsub
subscribe(), as in the below Traceback. Whilst our application catches
the relevant aiohttp errors when awaiting the subscribe() call, this
exception remained unhandled. This is because subscribe was ignoring the
tasks returned from the calls to asyncio.wait(), meaning any exception
results on these tasks would not be handled and the tasks would get
deleted when subscribe() returned.
Fix this by gathering the results of all worker tasks before returning
from subscribe(). Given that we're about to raise
asyncio.CancelledError() and return, there's no point in raising the
internal errors here, so just log them.
```
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gcloud/aio/pubsub/subscriber.py", line 403, in producer
new_messages = await asyncio.shield(pull_task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gcloud/aio/pubsub/subscriber.py", line 426, in producer
new_messages += await asyncio.wait_for(pull_task, 5)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/asyncio/tasks.py", line 479, in wait_for
return fut.result()
^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/gcloud/aio/pubsub/subscriber_client.py", line 157, in pull
resp = await s.post(
^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/gcloud/aio/auth/session.py", line 190, in post
resp = await self.session.post(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/aiohttp/client.py", line 560, in _request
await resp.start(conn)
File "/usr/lib/python3/dist-packages/aiohttp/client_reqrep.py", line 899, in start
message, payload = await protocol.read() # type: ignore[union-attr]
^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/aiohttp/streams.py", line 616, in read
await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: Server disconnected
```
Co-Authored-By: Kevin James <KevinJames@thekev.in>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Ensures that we use the emulated host when calling `get_signed_url()` while making use of the GCS emulator. Closes #828
Added missing `metadata_` when making subsequent posts to the `rewriteTo` API, as part of `aio.storage.Storage.copy`. This is necessary when copying large files, as multiple internal posts are advised.
The current Content-Range header is invalid, add the unit value. Closes #860
…le (#831) Added support for type 'impersonated_service_account' with fields 'source_credentials' and 'service_account_impersonation_url' which gcloud will use when you login with the flag --impersonate-service-account
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.1)
Can you help keep this open source service alive? 💖 Please sponsor : )