Unstructured-IO / Unstructured-IO/unstructured-python-client

bug/coroutine-await

オープン
#149 コメント 7 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug
主要言語
Python
スター
119
フォーク
22
平均マージ
1日 21時間
マージ済み PR(30日)
1

説明

Describe the bug
i'm currently using the open source version of unstructured, and getting an exception about coroutine is being awaited already. This causes the parse to fail, and not work.

To Reproduce
It just seems to happen every so often, I'm not sure how to reproduce it. It's not on the same files, if I retry them, they'll succeed. I am putting a lot of files + data through the system, but nothing that seems to be something it shouldnt be able to handle.

Expected behavior
Not get this error.

Screenshots
N/A

Environment Info
I'm pullling downloads.unstructured.io/unstructured-io/unstructured-api:latest as my container and just running this.
Also running unstructured-client = "^0.23.8" on my client side.

Additional context
There's also a few warning that are showing up related to coroutines too:

[2024-08-08 17:10:50,239: WARNING/MainProcess] /home/appuser/.cache/pypoetry/virtualenvs/app-9TtSrW0h-py3.11/lib/python3.11/site-packages/unstructured_client/_hooks/custom/split_pdf_hook.py:202: RuntimeWarning: coroutine 'SplitPdfHook.before_request.<locals>.call_api_partial' was never awaited
  self.coroutines_to_execute[operation_id] = []
[2024-08-08 17:47:48,365: WARNING/MainProcess] Traceback (most recent call last):
[2024-08-08 17:47:48,365: WARNING/MainProcess]   File "<string>", line 1, in <lambda>
[2024-08-08 17:47:48,365: WARNING/MainProcess] KeyError
[2024-08-08 17:47:48,365: WARNING/MainProcess] :
[2024-08-08 17:47:48,365: WARNING/MainProcess] '__import__'
[2024-08-08 17:47:48,366: WARNING/MainProcess] Exception ignored in:
[2024-08-08 17:47:48,366: WARNING/MainProcess] <coroutine object SplitPdfHook.before_request.<locals>.call_api_partial at 0x7f4753372480> 

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

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

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

unstructured_client/_hooks/custom/split_pdf_hook.py の 202 行目付近から始め、call_api_partial コルーチンがどのように保存され、await されているかを確認します。報告された高ボリュームのワークロードで断続的な失敗を再現し、その後、「coroutine is being awaited already」または「was never awaited」の警告なしにパースが完了することを確認します。

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

評価

技術スタック
python
領域
api
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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