ERROR swFactoryProcess_finish (ERROR 1004): send 66 byte failed, because session#134 is closed.

现在用的是swoole 1.8.4 版本,出现“ERROR swFactoryProcess_finish (ERROR 1004): send 66 byte failed, because session#134 is closed.”,后,进程挂掉。是什么原因?

2016-04-28 09:58
0
1

vellw

赞同来自: youngda

可以考虑给客户端在close之前()做个sleep(),sleep的时长可以根据情况设置. 我没有测试过源码,应该是客户端关闭后,fd已经无效,这时server仍然尝试给这个fd发送了消息或者命令导致的.

2017-12-15 10:38
0

nosun

赞同来自:

和我的竟然是同样的问题……

2016-04-28 14:54
0

braveryhui - phper ioser

赞同来自:

昨天刚升级的 1.8.4 也是这个问题 我倒是找到个 buffer的选项 http://wiki.swoole.com/wiki/page/440.html 但buffer只是个warn 这个是个错误

2016-04-28 15:57
0

nosun

赞同来自:

WARN swFactoryProcess_finish: send 189 byte failed, because session#4545 is closed.

这个是我的错误, 提示的是warn,但是master 进程不见了……

2016-04-28 16:34
0

nosun

赞同来自:

我的 版本是 1.7.22

2016-04-28 16:34
0

braveryhui - phper ioser

赞同来自:

补充错误环境 php 7.0.3 swoole 1.8.4

2016-04-28 18:56
0

braveryhui - phper ioser

赞同来自:

@nosun 你可以试试1.8.4 加上这个http://wiki.swoole.com/wiki/page/520.html ,问Rango 这个问题 Rango 说可以换 5.6 试试。

2016-04-30 11:33
0

braveryhui - phper ioser

赞同来自:

@nosun 你这个问题解决了么 ?

2016-05-01 12:00
0

braveryhui - phper ioser

赞同来自:

@Rango 我们生产环境跑的php7+swoole1.8.4 安装jemalloc 后出现该错误,但是swoole不挂了。但是我们的task重新调度会隔三差五的断,有没有更好的办法解决下这个问题呢 ?

[2016-04-30 14:02:54 *7503.7]   ERROR   swFactoryProcess_finish (ERROR 1004): send 93 byte failed, because session#867 is closed.
[2016-04-30 15:27:37 *26227.7]  ERROR   swFactoryProcess_finish (ERROR 1004): send 93 byte failed, because session#895 is closed.
[2016-04-30 15:31:36 *26227.7]  ERROR   swFactoryProcess_finish (ERROR 1004): send 93 byte failed, because session#985 is closed.
[2016-05-01 04:33:45 *17076.4]  ERROR   swFactoryProcess_finish (ERROR 1004): send 66 byte failed, because session#1673 is closed.
[2016-05-01 04:37:17 *17076.4]  ERROR   swFactoryProcess_finish (ERROR 1004): send 66 byte failed, because session#1680 is closed.
[2016-05-01 04:40:17 *17076.4]  ERROR   swFactoryProcess_finish (ERROR 1004): send 66 byte failed, because session#1686 is closed.
[2016-05-01 07:30:37 *3409.2]   ERROR   swFactoryProcess_finish (ERROR 1004): send 66 byte failed, because session#1888 is closed.
[2016-05-01 08:35:29 *3409.2]   ERROR   swFactoryProcess_finish (ERROR 1004): send 66 byte failed, because session#1954 is closed.
[2016-05-01 10:37:09 *3409.2]   ERROR   swFactoryProcess_finish (ERROR 1004): send 66 byte failed, because session#2045 is closed.
2016-05-01 12:06
0

nosun

赞同来自:

@braveryhui, 按照@Rango 的建议,升级到swoole master分支,稳定些了,因为同步搞ssl,没特别测试,但是上了ssl后,master 进程还是会挂,我怀疑我这边的问题和阿里云的负载均衡健康检测有关系,已经重新发了帖子,并在github上发了issue

2016-05-01 15:21
0

braveryhui - phper ioser

赞同来自:

@nosun 我也试试

2016-05-01 16:03
0

无解 - IT男

赞同来自:

我在做压力测试的时候也遇到了同样的问题 我的版本是 1.8.7,阿里云CentOS 6.5

[2016-08-11 11:17:24 *4601.28] ERROR swFactoryProcess_finish (ERROR 1004): send 1885 byte failed, because session#10097 is closed. [2016-08-11 11:17:24 *4601.28] ERROR swFactoryProcess_finish (ERROR 1004): send 8 byte failed, because session#10097 is closed. [2016-08-11 11:17:24 *4601.28] ERROR swFactoryProcess_finish (ERROR 1004): send 8 byte failed, because session#10097 is closed. [2016-08-11 11:17:24 *4587.14] ERROR swFactoryProcess_finish (ERROR 1004): send 8 byte failed, because session#10132 is closed. [2016-08-11 11:17:24 *4587.14] ERROR swFactoryProcess_finish (ERROR 1004): send 1881 byte failed, because session#10132 is closed. [2016-08-11 11:17:24 *4587.14] ERROR swFactoryProcess_finish (ERROR 1004): send 8 byte failed, because session#10132 is closed. [2016-08-11 11:17:24 *4587.14] ERROR swFactoryProcess_finish (ERROR 1004): send 8 byte failed, because session#10132 is closed.

2016-08-11 13:27
0

韩天峰 - 关注外星人

赞同来自:

ERROR swFactoryProcess_finish (ERROR 1004): send 8 byte failed, because session#10132 is closed.

这种错误请忽略吧,出错原因是发送数据时连接已经关闭了。有些客户端确实会出现这种情况。

2016-08-11 13:36
0

小弟

赞同来自:

同出现这个问题,昨天大面积出现改问题,导致页面无法访问,504错误。

swFactoryProcess_finish: send 2568 byte failed, because session#94 is closed.

初步怀疑是 Swoole\Client\Curl->get($url) 超时导致,但不确定。

Swoole 1.8.0 PHP 5.6.16

2016-08-12 10:34
0

包包不是包 - 80后IT男

赞同来自:

[2016-08-13 16:58:16 *2889.0]   ERROR   swFactoryProcess_finish (ERROR 1004): send 6 byte failed, because session#2549 is closed.
。。。
2016-08-13 18:08
0

sarboby - 90后 IT男

赞同来自:

ERROR swFactoryProcess_finish (ERROR 1004): send 34 byte failed, because session#1 is closed. [2016-10-01 01:56:25] INFO server close connection[1]. reason: client active close, code=1002, close_code = 1002 这个错误你们解决了吗

2016-09-30 17:58
0

未命名

赞同来自:

new swoole_client(SWOOLE_SOCK_TCP | SWOOLE_KEEP); 我让客户端使用长连接去创建,就没有报错了

2016-10-08 20:53
0

柯林 - 喜欢安静的写代码

赞同来自:

ERROR swFactoryProcess_finish (ERROR 1004): send 34 byte failed, because session#1 is closed

你们是如何解决的呢

2017-02-14 12:10
0

郭忠学

赞同来自:

php 7.1 + swoole 1.9.15 ERROR swFactoryProcess_finish (ERROR 1004): send 4 byte failed, because connection[fd=2] is closed.

2017-07-05 15:39
0

youngda

赞同来自:

vellw 说的很对

2018-05-12 12:55

要回复问题请先登录注册