Skip to content
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

秒杀超卖现象 #41

Open
lileming opened this issue May 21, 2020 · 2 comments
Open

秒杀超卖现象 #41

lileming opened this issue May 21, 2020 · 2 comments

Comments

@lileming
Copy link

一直存在一个疑问,在商城系统秒杀功能中。

1、假设库存只剩下1件了,A用户成功抢到并成功下单,但是A用户并没有支付

2、假设下单成功后15分钟内未支付,库存会回滚

3、A用户下单后,过了14分钟,发现订单未支付,于是发起微信支付,跳转到微信支付页面

4、进入支付页面后,输入支付密码,发现密码错误, A用户网络条件也不是很好,耽误了2分钟。最终输入正确的密码支付成功了。

5、而此时A的订单明显已经超时了,系统会把库存回滚。

6、回滚后,B用户看见有库存,马上下单,导致商品超卖

不知道我有没有描述清楚。这个问题一直困扰着我。

有想过在用户发起支付前给订单做个标识,让其晚点回滚,但是如果用户在支付页面耽误很久,也无济于事。

@446532385
Copy link

446532385 commented May 21, 2020 via email

@justinbaby
Copy link

A超时被系统取消订单后(相当于没买),因为已付款所以系统会发起退款操作,财务审核通过最后退钱

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants