Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Connection closed

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

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

評価

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

調査の方向性

まず、示されている timeout と max_conn_per_addr の設定を使用して Workerman\Http\Client::post による同時リクエストを再現し、順次送信した場合と短時間に連続して送信した場合を比較します。issue に記載されている単一 worker の構成と curl_multi との比較を確認します。"Connection closed" という結果の原因を特定し、同時リクエストで期待される動作を確認できれば完了です。

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

説明

I decided use http client in my worker.
Server part works on workerman Worker with one thread ( $worker->count = 1; ) Business logic requires it.

Part of http client here :

$http = new Workerman\Http\Client(
['max_conn_per_addr' => 128,
  'keepalive_timeout' => 15,
   'connect_timeout'   => 30,
   'timeout'           => 30,
]);
$t=microtime(1);
$http->post('http://127.0.0.1:8080', ['command'=>'ping'], 
function ($response) { echo "ok\n"; }, 
function ($exception) use($t){ echo ' exception ['.substr($exception,0,57).']</b> diff:'.(microtime(1)-$t).s"\n"; }
);

So, when i post queries sequentially all work fine and quick. But if i send multiple quries - http client very quickly (0.1sec) recieve exception "Connection closed". I was expect that it will wait answer from server up to 30 seconds, but not.
If I use another asynchronous method of client operation via curl_multi I don’t observe such server behavior.
May be i need some tune of psr7 ? Or do you have any smart thoughts on this topic?

Thank you for your product and attention to it.

主要言語
PHP
スター
55
フォーク
19
PR マージ指標
30日以内にマージされた PR はありません

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

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

はじめの一歩

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

workerman-php/http-client のほかの issue

workerman-php/http-client の issue をすべて見る

似ている issue

PHP の issue をもっと見る

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

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