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
fromaiohttpimportwebfrompaniniimportappaspanini_appimportsentry_sdkimportsettingsapp=panini_app.App(
service_name='nats-microservice-that-also-http',
host='127.0.0.1',
port=4222,
)
app.setup_web_server(port=5000)
@app.listen("some.subject")asyncdefstream_listener(msg):
print(f"event {msg.data} from {msg.subject} has been processed")
@app.http.get("/status")asyncdefweb_endpoint_listener(request):
returnweb.json_response({"status": "ok"})
if__name__=="__main__":
sentry_sdk.init(settings.SENTRY_SDK)
app.start()
aiohttp GET /status endpoint responds correctly, but a runtime error is sent to the sentry on every request: RuntimeError("Event loop stopped before Future completed.")
The text was updated successfully, but these errors were encountered:
Hello @alexreznikoff
The problem is in the conflict related to sentry behavior (I have not worked with sentry before and do not know how it works). I ran your code without sentry and it works well. I would recommend trying to run sentry as a panini task:
fromaiohttpimportwebfrompaniniimportappaspanini_appimportsentry_sdkimportsettingsapp=panini_app.App(
service_name='nats-microservice-that-also-http',
host='127.0.0.1',
port=4222,
)
app.setup_web_server(port=5000)
@app.task()defstart_sentry():
sentry_sdk.init(settings.SENTRY_SDK)
@app.listen("some.subject")asyncdefstream_listener(msg):
print(f"event {msg.data} from {msg.subject} has been processed")
@app.http.get("/status")asyncdefweb_endpoint_listener(request):
returnweb.json_response({"status": "ok"})
if__name__=="__main__":
app.start()
My test application uses:
Code:
aiohttp
GET /status
endpoint responds correctly, but a runtime error is sent to the sentry on every request:RuntimeError("Event loop stopped before Future completed.")
The text was updated successfully, but these errors were encountered: