Silent app exit: unhandled exceptions in callbacks / background threads are never logged (desktop 0.86.x)
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 62/100
- issue の種類
- ドキュメント
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
- 領域
- backend, documentation
調査の方向性
エラー処理のドキュメントと、issueで言及されている page.run_task() に関する1.0 cookbookのセクションから始めます。それらのドキュメントでcallbackとバックグラウンドスレッドの例外がどのように説明されているかを確認し、サポートされているグローバルフックの設定を記載するか、これらの場合のFletの動作を明確にします。エラー処理のドキュメントで、何がログに記録されるか、ユーザーが未処理の例外をどのように捕捉できるかを説明できたら完了です。
索引モデルが issue の本文から書いたものです。
説明
Split out of #7100 so it can be tracked independently.
Environment
- Flet 0.86.5, Python 3.14, Windows 11
- Packaged as a single desktop executable (no console attached)
- The app uses long-lived background workers and timer-driven UI updates
Observed behaviour
A packaged build occasionally exited with nothing shown to the user. The last
line in the application log was:
20:12:12 Session was garbage collected
followed by silence: no on_disconnect, no shutdown record, no traceback.
Try/except around individual event handlers did not capture the failure.
Diagnosis
The exception was raised in a Flet event callback or in a background thread,
outside the code path covered by the application's normal logging. With no
console attached, Python's default handling produced nothing useful.
Installing three hooks at startup made the next failure fully visible:
sys.excepthookthreading.excepthookasyncio.get_running_loop().set_exception_handler(...)
After that, the next crash produced a complete stack trace in the log. Without
those hooks the failure is effectively invisible, which makes it very hard to
file a useful bug report.
What would help
The 1.0 cookbook now documents that an un-awaited page.run_task() future logs
its exception through Flet. It does not say what happens to exceptions raised in
plain worker threads, or in a callback that is not a coroutine.
Could Flet either:
- log unhandled callback / thread exceptions to the console log by default in
desktop mode, or - document the recommended global-hook setup as the supported pattern?
A short note in the error-handling docs would already save a lot of blind
debugging. Optionally, emitting a pending-exception summary at session
garbage-collection time would make these silent exits reportable.
No project-specific data is included; the log line above is generic.
- 主要言語
- Python
- スター
- 17.6k
- フォーク
- 753
- 平均マージ
- 2日 8時間
- マージ済み PR(30日)
- 64
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
flet-dev/flet のほかの issue
-
feature request
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
flet-dev/flet#6985 · コメント 3 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug: dataclass_transform() uses should include `field_specifiers` argument対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
Desktop 0.86.x: silent callback crashes, ambiguous run_thread/run_task semantics, and focus() no-op via run_task対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
bug: InputFilter number checking対応中かも @ndonkoHenri が今日担当しました。 オープンbug
flet-dev/flet#7098 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
feature request
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
mozilla-ai/cq#601 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
intcomma returns exponential notation for large floats対応中かも @Omarinho12345 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
python-humanize/humanize#521 ·
メンテナーはふだん 1 日以内に返信
-
LUCJ pass manager raises NoEdgeBetweenNodes when an edge is bad for two two-qubit gates対応中かも @hat-im が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
opensubtitlescom: provider rejects pt-PT even though its own converter maps it対応中かも @paulo-0308 が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
Diaoul/subliminal#1405 ·