Replies: 4 comments 9 replies
-
skynet.exit 退出时的处理逻辑见 https://github.com/cloudwu/skynet/blob/master/lualib/skynet.lua#L647 |
Beta Was this translation helpful? Give feedback.
2 replies
-
static void
drop_message(struct skynet_message *msg, void *ud) {
struct drop_t *d = ud;
skynet_free(msg->data);
uint32_t source = d->handle;
assert(source);
// report error to the message source
skynet_send(NULL, source, msg->source, PTYPE_ERROR, msg->session, NULL, 0);
} 服务退出时,未处理的消息会上报ERROR消息给来源方。 |
Beta Was this translation helpful? Give feedback.
1 reply
-
正常应该不会永远挂起才对 |
Beta Was this translation helpful? Give feedback.
1 reply
-
local skynet = require "skynet"
local service = require "skynet.service"
local function serverA()
local skynet = require "skynet.manager"
local skynet_util = require "skynet-fly.utils.skynet_util"
local CMD = {}
function CMD.hello()
skynet.error("hello")
end
skynet.fork(function()
skynet.error("A call B begin")
skynet.call('.B', 'lua', 'hello')
skynet.error("A call B end")
end)
skynet.fork(function()
local now = skynet.time()
while true do
if skynet.time() > now + 3 then
skynet.exit()
break
end
end
end)
skynet_util.lua_dispatch(CMD)
skynet.register('.A')
end
local function serverB()
local skynet = require "skynet.manager"
local skynet_util = require "skynet-fly.utils.skynet_util"
local CMD = {}
function CMD.hello()
skynet.error("B call A begin")
skynet.call('.A', 'lua', 'hello')
skynet.error("B call A end")
end
skynet_util.lua_dispatch(CMD)
skynet.register('.B')
end
skynet.start(function()
service.new("B", serverB)
service.new("A", serverA)
end)
按照你的描述复写程序,被没有出现skynet.call永久被挂起 |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
A,B两个服务,在A执行
可以看到B服务被挂起,A服务器在exit退出的时候没有返回func2请求(func2函数可以是空函数)
这种情况正常吗?还是skynet本身在exit的时候没有处理C代码中的msg?
可否退出的时候对存储在c代码中的msg做flush处理?
这个bug今年1月份修复了,我用的23年6月的分支,结案,叨扰大家了
Beta Was this translation helpful? Give feedback.
All reactions