fluent / fluent/fluent-logger-python

sock.connect hang

オープン
#175 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
457
フォーク
138
PR マージ指標
30日以内にマージされた PR はありません

説明

I encountered a problem when using asyncsender, the fastapi project, fluent-logger==0.9.6

When I was running pytest, I found that it would be blocked for a long time after the pytest ended

And not any log to tell me why, stuck here for a while time

Found that when the logger sends logs, each log will be blocked for 20 seconds because of socket connect.

Because the fluent address error, every time when `_send_loop` consume a log, it will trigger `_reconnect`.

And each `_reconnect` will took 20 seconds. I thought of two ways
- maybe there is a way that we can add timeout on connect
- when we meeted this kind error, we clear the queue and print some log

Sorry about the bad english :). Feel free to close this if un-needed :)

![image](https://user-images.githubusercontent.com/22811481/115949548-8125ed80-a508-11eb-932f-8295d4b1545a.png)

![image](https://user-images.githubusercontent.com/22811481/115949056-bc262200-a504-11eb-9245-60ce2fb673ef.png)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

まず logger の _send_loop と _reconnect の経路を追跡し、次に無効な Fluent アドレスを使って pytest で動作を再現します。ソケット接続の失敗によってログの消費がどのようにブロックされるかを確認し、選択した処理によって 20 秒の停止が繰り返されるのを防ぎつつ、報告された診断動作が提供されることを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
observability
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。