Consumer.wait() blocks indefinitely
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 25/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- javascript, python
調査の方向性
couchdbkit/consumer/init.py と couchdbkit/consumer/sync.py から開始し、次に restkit/wrappers.py、および traceback に示されている http_parser の reader と socket I/O まで、レスポンスのクリーンアップ処理を追跡します。継続的なフィルター付き _changes リクエストに対して Consumer.wait() を再現し、curl と比較します。クライアントが予期せずブロックしなくなり、回帰テストでこの動作がカバーされれば完了です。
索引モデルが issue の本文から書いたものです。
説明
I have a strange issue where Consumer.wait() blocks indefinitely, that is not reproducible using curl.
Basically I'm registering a Consumer for a (rather large) database with a specific since-value (53000000 in my case)
consumer = Consumer(db)
consumer.wait(self.callback, since=since, include_docs=True)
The callback receives and processes three results, and the call then blocks in
^CTraceback (most recent call last):
File "./manage.py", line 36, in <module>
execute_manager(settings)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 469, in execute_manager
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 222, in run_from_argv
self.execute(*args, **options.__dict__)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/base.py", line 255, in execute
output = self.handle(*args, **options)
File "/srv/mygpo/mygpo/../mygpo/maintenance/management/changescmd.py", line 59, in handle
self.process(self.db, since)
File "/srv/mygpo/mygpo/../mygpo/maintenance/management/changescmd.py", line 100, in process
consumer.wait(self.callback, since=since, **params)
File "/usr/local/lib/python2.7/dist-packages/couchdbkit-0.6.4-py2.7.egg/couchdbkit/consumer/__init__.py", line 103, in wait
return self._consumer.wait(cb, **params)
File "/usr/local/lib/python2.7/dist-packages/couchdbkit-0.6.4-py2.7.egg/couchdbkit/consumer/sync.py", line 56, in wait
break
File "/usr/local/lib/python2.7/dist-packages/restkit-4.2.1-py2.7.egg/restkit/wrappers.py", line 161, in __exit__
self.close()
File "/usr/local/lib/python2.7/dist-packages/restkit-4.2.1-py2.7.egg/restkit/wrappers.py", line 169, in close
self.body.read()
File "/usr/local/lib/python2.7/dist-packages/http_parser-0.8.1-py2.7-linux-x86_64.egg/http_parser/reader.py", line 33, in readinto
recved = self.http_stream.stream.readinto(buf)
File "/usr/local/lib/python2.7/dist-packages/http_parser-0.8.1-py2.7-linux-x86_64.egg/http_parser/_socketio.py", line 70, in readinto
return _recv_into_sock(self._sock, b)
File "/usr/local/lib/python2.7/dist-packages/http_parser-0.8.1-py2.7-linux-x86_64.egg/http_parser/_socketio.py", line 24, in <lambda>
_recv_into_sock = lambda sock, buf: sock.recv_into(buf)
KeyboardInterrupt
In the CouchDB log the query shows up as
[Sun, 03 Mar 2013 12:08:58 GMT] [info] [<0.9352.205>] 127.0.0.1 - - GET /mygpo/_changes?feed=continuous&since=53000000&filter=episode_states%2Fhas_play_events&include_docs=true 200
If I repeat the same call with curl, it quickly returns a large number of additional results. I'd therefore rule out an issue on the CouchDB side.
The filter that is used in the query is shown below.
function(doc, req)
{
if(doc.doc_type != "EpisodeUserState")
{
return false;
}
if(doc._deleted == true)
{
return false;
}
if(!doc.actions)
{
return false;
}
function isPlayEvent(action)
{
return action.action == "play";
}
return doc.actions.some(isPlayEvent);
}
I've tested and reproduced that with the latest version of couchdbkit, and have since upgraded couchdbkit (as well as restkit and http-parser) to their latest HEADs to rule out any recently fixed issues.
Any suggestions on how to further debug this?
- 主要言語
- Python
- スター
- 261
- フォーク
- 90
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
benoitc/couchdbkit のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
benoitc/couchdbkit#181 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
benoitc/couchdbkit#196 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
benoitc/couchdbkit#194 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
benoitc/couchdbkit#193 · コメント 2 件 · リアクション 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 48/100
benoitc/couchdbkit#192 ·
benoitc/couchdbkit の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
-
area:other help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
WingedGuardian/GENesis-AGI#4734 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
peach-mitao/peach#693 ·
メンテナーはふだん 1 日以内に返信
-
Failed result serialization destroys a previously saved JSON result対応中かも @chessing234 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
huggingface/evaluate#867 ·
-
FTP reads inside a transaction use a nonexistent staging path対応中かも @Harsh23Kashyap が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
fsspec/filesystem_spec#2463 ·
メンテナーはふだん 1 日以内に返信