Coder Social home page Coder Social logo

是否支持timeout机制? about gengine HOT 5 OPEN

bilibili avatar bilibili commented on August 17, 2024
是否支持timeout机制?

from gengine.

Comments (5)

rencalo770 avatar rencalo770 commented on August 17, 2024

这个要分情况了,如果本身就是需要执行那么长时间,显然用户应该是清楚的,在pool中执行的时候只会占用一个具体的gengine实例,只要将pool len设置长一点,确保请求来的时候有足够的实例提供服务就行;
如果是因为数据库卡顿、外部请求导致的长时间阻塞,那么这个直接对具体的数据库,或者request设置timeout即可;
如果是因为bug导致的长时间不释放,那就去解决bug就好啦

from gengine.

liyizhecn avatar liyizhecn commented on August 17, 2024

感谢回复。
引擎开发和规则的运营,可能(大概率)是两个不同的团队,而规则运营团队不关心引擎底层实现。
因此引擎需要一个自我保护的机制,避免被运营团队搞死,例如:

  1. 运营团队提交了一个引用三方服务,但未设置超时时间的规则
  2. 运营团队提交的规则有bug
  3. 运营团队提交了一个测试性质的规则,他们自己可能也不太确定要跑多久

那么,此时可能需要一个自动的或者可以外部调用的kill方法,能(仅)将该条规则的运行时强制关闭,并下线。

from gengine.

rencalo770 avatar rencalo770 commented on August 17, 2024

等我们上线了ui之后,我们会进一步思考这个机制

from gengine.

liyizhecn avatar liyizhecn commented on August 17, 2024

看上去可以借鉴 context.WithTimeout 的思路

from gengine.

rencalo770 avatar rencalo770 commented on August 17, 2024

看上去可以借鉴 context.WithTimeout 的思路

context的timeout可行!

from gengine.

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.