-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
当gotask抛出panic后gotask会一直尝试重连 #15
Comments
先解决panic问题吧。 go进程没有正确退出,所以没有释放socket端口。 |
建议加个全局中间件捕获所有panic,不然程序代码意外出现panic会导致导致整个go进程没有正确退出,没有释放socket端口。结果就是只能重启服务才能恢复正常。。 |
这个我还要考虑一下是gotask加合适还是用户自己加合适。 |
这个应该是通用功能的吧,我现在直接用gin的中间件捕获所有panic异常了,不然程序意外出现panic导致整个go进程崩了,只有重启一条路了。 |
用户侧控制panic更灵活。比如,当panic时,返回什么给PHP?这个只有用户层知道,框架层没法知道。 |
增加了例子和对应单测。 Line 52 in b0668d5
|
2.0.3 已发布,每次重启时如果发现unixsocket已存在会删掉之前的,这样如果go挂了,swoole把go拉起时不受端口占用影响。 |
我弄了个全局捕获panic的中间件,主要是担心挂了后即使能重新拉起,但是挂之前一些没处理完的请求也会直接挂掉,就是为了保障任何一个请求出问题都不能影响其他请求的处理 |
顺便问下,升级版本,php和go两边的包都要同时升级吗 |
feature版本建议两边都升,小版本可以任意。
我觉得挺好。你看gin也是外放出来让用户自己添加异常中间件的。 |
我现在在用的是2.0.1版本,可以只升级go这边的包不升级php的吗 |
没问题。 |
貌似这个问题不该问,自己试下就知道了。。大佬的回复速度真快。。 |
其他接口再访问的时候返回
error:unable to establish connection unix:///tmp/messages_5ecc7c974d45a.sock
The text was updated successfully, but these errors were encountered: