Code Monkey home page Code Monkey logo

Comments (8)

cloudwu avatar cloudwu commented on July 19, 2024
  1. 你先确定一下 "Too many open files" 是从 C 的哪一行抛出来的?
  2. 确定代码更新到最新。

from skynet.

sniper00 avatar sniper00 commented on July 19, 2024

自动重连捕获到网络错误时,建议sleep(1s) 再进行重连尝试

from skynet.

lsx1994 avatar lsx1994 commented on July 19, 2024

自动重连捕获到网络错误时,建议sleep(1s) 再进行重连尝试

不是重连问题,客户端代码我都屏蔽了只留了 websocket.connect,具体原因我还在查
目前定位到打印log的位置是:https://github.com/cloudwu/skynet/blob/master/skynet-src/socket_server.c#L1683

from skynet.

lsx1994 avatar lsx1994 commented on July 19, 2024
  1. 你先确定一下 "Too many open files" 是从 C 的哪一行抛出来的?
  2. 确定代码更新到最新。

问题找到了,把open files改成100, 启动100个机器人。 机器人请求httpc.request成功后连接websocket,大概在第77个httpc.request处出错,服务器会无限打印log。 单独测试没问题应该是httpc.request用完就释放了,所以没达到上限。

我在 https://github.com/cloudwu/skynet/blob/master/skynet-src/socket_server.c#L1578 下添加close(client_fd); 就正常了,但是不会打印 openfile limit的错误了。

https://github.com/cloudwu/skynet/blob/master/skynet-src/socket_server.c#L1584 下添加 close(client_fd); 还是会无限打印。

from skynet.

lsx1994 avatar lsx1994 commented on July 19, 2024

不好意思,没查明原因就提问,我下次会注意。

from skynet.

cloudwu avatar cloudwu commented on July 19, 2024

看看 emfile 分支上的 patch 能否解决这个问题。我暂时没有测试。

from skynet.

lsx1994 avatar lsx1994 commented on July 19, 2024

看看 emfile 分支上的 patch 能否解决这个问题。我暂时没有测试。

不会无限打印log了, 但是socket的openfiles没打印,文件打开上限skynet.require先报错了。

from skynet.

lsx1994 avatar lsx1994 commented on July 19, 2024

可以了,一切正常

from skynet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.