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

bug/coroutine-await

Đang mở
#149 7 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

bug
Ngôn ngữ chính
Python
Star
119
Fork
22
Merge trung bình
1 ngày 21 giờ
Pull request đã merge (30 ngày)
1

Mô tả

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> 

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với unstructured_client/_hooks/custom/split_pdf_hook.py quanh dòng 202 và xem xét cách các coroutine call_api_partial được lưu trữ và await. Tái hiện lỗi không liên tục với khối lượng công việc lớn đã được báo cáo, sau đó xác minh rằng quá trình phân tích hoàn tất mà không có các cảnh báo “coroutine is being awaited already” hoặc “was never awaited”.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
api
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.