Git Product home page Git Product logo

Comments (13)

Reasno avatar Reasno commented on July 30, 2024

先解决panic问题吧。

go进程没有正确退出,所以没有释放socket端口。

from gotask.

yzdzh avatar yzdzh commented on July 30, 2024

建议加个全局中间件捕获所有panic,不然程序代码意外出现panic会导致导致整个go进程没有正确退出,没有释放socket端口。结果就是只能重启服务才能恢复正常。。

from gotask.

Reasno avatar Reasno commented on July 30, 2024

建议加个全局中间件捕获所有panic,不然程序代码意外出现panic会导致导致整个go进程没有正确退出,没有释放socket端口。结果就是只能重启服务才能恢复正常。。

这个我还要考虑一下是gotask加合适还是用户自己加合适。

from gotask.

yzdzh avatar yzdzh commented on July 30, 2024

这个应该是通用功能的吧,我现在直接用gin的中间件捕获所有panic异常了,不然程序意外出现panic导致整个go进程崩了,只有重启一条路了。

from gotask.

Reasno avatar Reasno commented on July 30, 2024

这个应该是通用功能的吧,我现在直接用gin的中间件捕获所有panic异常了,不然程序意外出现panic导致整个go进程崩了,只有重启一条路了。

用户侧控制panic更灵活。比如,当panic时,返回什么给PHP?这个只有用户层知道,框架层没法知道。

from gotask.

Reasno avatar Reasno commented on July 30, 2024

增加了例子和对应单测。

func (a *App) HelloPanic(name interface{}, r *interface{}) (e error) {

from gotask.

Reasno avatar Reasno commented on July 30, 2024

2.0.3 已发布,每次重启时如果发现unixsocket已存在会删掉之前的,这样如果go挂了,swoole把go拉起时不受端口占用影响。

from gotask.

yzdzh avatar yzdzh commented on July 30, 2024

2.0.3 已发布,每次重启时如果发现unixsocket已存在会删掉之前的,这样如果go挂了,swoole把go拉起时不受端口占用影响。

我弄了个全局捕获panic的中间件,主要是担心挂了后即使能重新拉起,但是挂之前一些没处理完的请求也会直接挂掉,就是为了保障任何一个请求出问题都不能影响其他请求的处理

from gotask.

yzdzh avatar yzdzh commented on July 30, 2024

顺便问下,升级版本,php和go两边的包都要同时升级吗

from gotask.

Reasno avatar Reasno commented on July 30, 2024

p和go两边的包都要同时升级吗

feature版本建议两边都升,小版本可以任意。

我弄了个全局捕获panic的中间件,主要是担心挂了后即使能重新拉起,但是挂之前一些没处理完的请求也会直接挂掉,就是为了保障任何一个请求出问题都不能影响其他请求的处理

我觉得挺好。你看gin也是外放出来让用户自己添加异常中间件的。

from gotask.

yzdzh avatar yzdzh commented on July 30, 2024

p和go两边的包都要同时升级吗

feature版本建议两边都升,小版本可以任意。

我弄了个全局捕获panic的中间件,主要是担心挂了后即使能重新拉起,但是挂之前一些没处理完的请求也会直接挂掉,就是为了保障任何一个请求出问题都不能影响其他请求的处理

我觉得挺好。你看gin也是外放出来让用户自己添加异常中间件的。

我现在在用的是2.0.1版本,可以只升级go这边的包不升级php的吗

from gotask.

Reasno avatar Reasno commented on July 30, 2024

p和go两边的包都要同时升级吗

feature版本建议两边都升,小版本可以任意。

我弄了个全局捕获panic的中间件,主要是担心挂了后即使能重新拉起,但是挂之前一些没处理完的请求也会直接挂掉,就是为了保障任何一个请求出问题都不能影响其他请求的处理

我觉得挺好。你看gin也是外放出来让用户自己添加异常中间件的。

我现在在用的是2.0.1版本,可以只升级go这边的包不升级php的吗

没问题。

from gotask.

yzdzh avatar yzdzh commented on July 30, 2024

p和go两边的包都要同时升级吗

feature版本建议两边都升,小版本可以任意。

我弄了个全局捕获panic的中间件,主要是担心挂了后即使能重新拉起,但是挂之前一些没处理完的请求也会直接挂掉,就是为了保障任何一个请求出问题都不能影响其他请求的处理

我觉得挺好。你看gin也是外放出来让用户自己添加异常中间件的。

我现在在用的是2.0.1版本,可以只升级go这边的包不升级php的吗

没问题。

貌似这个问题不该问,自己试下就知道了。。大佬的回复速度真快。。

from gotask.

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.