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
think-mysql 升级到 1.4.0 线上经常卡死 #1372
Comments
可以贴一下你事务相关的代码么?事务里面需要用db()来复用连接。#1334 |
都检查了几十遍了,而且是相同的业务代码,以前没有任何问题,自从升级到think-mysql 1.4.0,就开始出现。绝对不是db()复用的问题 |
而且每天都会卡住。都升级了些啥啊。 |
有部分客户还没又升级的,用的是 think-mysql 1.2.5 出现任何问题,升级的,每天都卡住。相同的代码。 |
哥们我怎么退回去,并且指定用1.2..5,这不是坑人吗,几百客户,的收银台,天天卡住。都疯了。 |
MySQL 的配置提供下吧,把关键信息过滤一下。 |
云数据库的配置? |
@arterli 想看一下你有没有配线程池相关的配置。你如果确认 |
@lizheming 好,因为是自动安装,自动安装会用安装最新版的依赖,所以新安装的1.4.0的,都出问题了,上百个呢,我先一个一个恢复到 1.2.5 |
@arterli 已经安装了的话没太多办法,写个批量脚本执行下吧。我们尽快看下这个问题,具体QQ沟通。 |
一个事务未完成时,开启另一个事务会报错。 async indexAction() {
const model = think.model('user')
await model.transaction(async () => {
/** 模拟事务需要5秒执行完成 */
await new Promise(res => setTimeout(res, 5000))
})
return this.success('hello')
} |
https://thinkjs.org/doc/3.0/relation_model.html#toc-e30
参考下这里。事物里面嵌套model,要处理下。
…------------------ 原始邮件 ------------------
发件人: "CaiZhiYong"<notifications@github.com>;
发送时间: 2019年5月31日(星期五) 下午5:35
收件人: "thinkjs/thinkjs"<thinkjs@noreply.github.com>;
抄送: "阿特"<arterli@qq.com>; "Mention"<mention@noreply.github.com>;
主题: Re: [thinkjs/thinkjs] think-mysql 升级到 1.4.0 线上经常卡死 (#1372)
一个事务未完成时,开启另一个事务会报错。cannot create more connection in transation, use db() to reuse connection! 。例如用下面代码,在5秒内请求两次就会报错:
async indexAction() { const model = think.model('user') await model.transaction(async () => { /** 模拟事务需要5秒执行完成 */ await new Promise(res => setTimeout(res, 5000)) }) return this.success('hello') }
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
@arterli 你好,我这个例子怎么处理好呢?里面没有用到嵌套model的。 |
@bravecat 请提供一个最小可复现的环境,我拿着你之前给的代码在本地试了是 OK 的,具体见截图。 |
@lizheming 你好,我测试下最新的 |
@bravecat 新版本没有那就忽略吧 |
DESC
think-mysql 升级到 1.4.0 线上经常卡死,
ENV
OS Platform:
Node.js Version:
ThinkJS Version:
code
// your code here
error message
more description
// your detail description
The text was updated successfully, but these errors were encountered: