Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

新起独立节点连接异常 #13

Closed
JieTrancender opened this issue Apr 15, 2022 · 10 comments
Closed

新起独立节点连接异常 #13

JieTrancender opened this issue Apr 15, 2022 · 10 comments

Comments

@JieTrancender
Copy link

新起一个最简单节点服务(独立进程)尝试将master节点和agent节点分离,代码如下:

local skynet = require "skynet"
local swt       = require "swt"

skynet.start(function()
    swt.start_agent("app", "test", "0.0.0.0:23088")
end)

启动后会有如下报错,麻烦看看。

11:05:04 [9] lua call [0 to :9 : 0 msgsz = 24] error : ./skynet/lualib/skynet.lua:642: ./skynet/lualib/skynet.lua:184: ./skynet/lualib/skynet/socket.lua:184: socket is not closed
stack traceback:
	[C]: in function 'assert'
	./skynet/lualib/skynet/socket.lua:184: in function <./skynet/lualib/skynet/socket.lua:169>
	(...tail calls...)
	./skynet/lualib/http/websocket.lua:392: in function 'http.websocket.accept'
	./lualib/swt/http_helper.lua:29: in function 'swt.http_helper.upgrade'
	(...tail calls...)
	./lualib/router.lua:126: in method 'execute'
	./lualib/swt/http_helper.lua:54: in function 'swt.http_helper.dispatch'
	./skynet/lualib/skynet.lua:555: in upvalue 'f'
	./skynet/lualib/skynet.lua:141: in function <./skynet/lualib/skynet.lua:113>
stack traceback:
@lsg2020
Copy link
Owner

lsg2020 commented Apr 15, 2022

测试正常的呀,你有修改config里的 start = "main" -- main script 为你分离的启动脚本文件吗

@JieTrancender
Copy link
Author

JieTrancender commented Apr 15, 2022 via email

@lsg2020
Copy link
Owner

lsg2020 commented Apr 15, 2022

可能是skynet版本不对吧,之前一直没升级,刚升级到了最新的skynet版本了

@cloudfreexiao
Copy link

cloudfreexiao commented Apr 15, 2022

node 高版本 运行 后台代码会有兼容问题 删除这个 依赖好像没啥太大问题

laverdet/node-fibers#451

      yarn run v1.22.18
      $ vue-cli-service serve
       INFO  Starting development server...
      node: ../src/coroutine.cc:134: void* find_thread_id_key(void*): Assertion `thread_id_key != 0x7777' failed.
      Aborted
      error Command failed with exit code 134.

直接 对 service_snlua 修改 需要 继续 保持嘛

https://github.com/lsg2020/skynet/commit/aecaa9a7745bdbfa362d773ed8088622a707de63

@lsg2020
Copy link
Owner

lsg2020 commented Apr 16, 2022

@cloudfreexiao 多谢提醒,现在snlua加了profile_context的指针 lsg2020/skynet@4ace42e
这样升级起来简单一些,有时间也麻烦帮忙检查看看

@cloudfreexiao
Copy link

cloudfreexiao commented Apr 16, 2022

不是很明白这个 提交里 关于 coroutine.create 的修改 觉得没区别的样子

@lsg2020
Copy link
Owner

lsg2020 commented Apr 16, 2022

因为skynet.lua比较早的引入,保存了coroutine.create会导致这里捕获不到后续的协程创建

c.mark()

@cloudfreexiao
Copy link

好的

@JieTrancender
Copy link
Author

可能是skynet版本不对吧,之前一直没升级,刚升级到了最新的skynet版本了

囧,是skynet版本不对报错的。内部维护了两个版本,lua5.4版本的同步你的修改后可以正常使用。
线上项目还是使用的skynet升级5.4之前的版本,所以最开始测试的时候失败咯。

@JieTrancender
Copy link
Author

线上项目新切分支更新skynet完成了测试,感谢。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants