You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
I tried using the QueuedAioHttpTransport for the transport and noticed that it generates errors if there are too many alerts firing.
#!/usr/bin/env python3
import asyncio
from functools import partial
import logging
import raven
from raven.handlers.logging import SentryHandler
from raven_aiohttp import QueuedAioHttpTransport
logging.basicConfig(
format='[%(asctime)s] %(levelname)s - %(message)s',
datefmt='%Y-%m-%d %H:%M:%S',
level=logging.INFO
)
LOG = logging.getLogger(__name__)
if __name__ == '__main__':
loop = asyncio.get_event_loop()
dsn = 'http://<key>:<secret>@localhost:9000/1'
transport = partial(QueuedAioHttpTransport, workers=1, loop=loop, keepalive=True)
client = raven.Client(dsn, transport=transport)
handler = SentryHandler(client)
handler.setLevel(logging.ERROR)
logging.getLogger().addHandler(handler)
for _ in range(2):
LOG.error('test')
loop.run_until_complete(client.remote.get_transport().close())
loop.close()
Running the script produces:
[2017-12-06 12:10:30] ERROR - test
[2017-12-06 12:10:30] ERROR - test
[2017-12-06 12:10:30] ERROR - Sentry responded with an error: None (url: http://localhost:9000/api/1/store/)
Traceback (most recent call last):
File "<lib-path>raven-aiohttp/raven_aiohttp.py", line 96, in _do_send
timeout=self.timeout
File "<env-path>/lib/python3.6/site-packages/aiohttp/helpers.py", line 97, in __iter__
ret = yield from self._coro
File "<env-path>/lib/python3.6/site-packages/aiohttp/client.py", line 241, in _request
yield from resp.start(conn, read_until_eof)
File "<env-path>/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 559, in start
(message, payload) = yield from self._protocol.read()
File "<env-path>/lib/python3.6/site-packages/aiohttp/streams.py", line 509, in read
yield from self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: None
b'Sentry responded with an error: None (url: http://localhost:9000/api/1/store/)'
[2017-12-06 12:10:30] ERROR - ['test']
b"['test']"
Sometimes, aiohttp.client_exceptions.ClientOSError would be thrown instead of aiohttp.client_exceptions.ServerDisconnectedError. Using AioHttpTransport as the transport did not cause any issue.
The text was updated successfully, but these errors were encountered:
Environment (
python v3.6
):I tried using the
QueuedAioHttpTransport
for the transport and noticed that it generates errors if there are too many alerts firing.Running the script produces:
Sometimes,
aiohttp.client_exceptions.ClientOSError
would be thrown instead ofaiohttp.client_exceptions.ServerDisconnectedError
. UsingAioHttpTransport
as the transport did not cause any issue.The text was updated successfully, but these errors were encountered: