Giter VIP home page Giter VIP logo

Comments (3)

WXzhongwang avatar WXzhongwang commented on June 16, 2024 1

这种情况是考虑是回滚redis数据还是增加ack时间。感觉都不是太好。盼回复

from jseckill.

bootsrc avatar bootsrc commented on June 16, 2024

我觉得应该回滚redis数据。 毕竟增加ack时间,这个会导致mq消息大量积压,拖垮系统。

from jseckill.

myhearis avatar myhearis commented on June 16, 2024

这里我也发现是有bug的,因为浏览器是通过接口去轮询,而作者写的轮询接口逻辑是这样的:1、先查看秒杀成功的商品set集合中是否存在用户手机号,存在,返回秒杀成功。不存在,则判断redis中推送成功的消息set集合,这里是重点!当你ack超时,但是却成功推送到了MQ中,将不会记录到Redis中!于是在redis中找不到推送成功的记录(实际上已经推送成功了),于是给浏览器返回秒杀失败,但是实际上已经成功了!这是问题所在,解决这个问题有我觉得有这些方法,1、完善这个请求秒杀状态的接口,及时将推送成功信息写入redis中。2、适当增加等待ack的时间,如指数退避算法。3、没有接收到ack请求的,一律忽略,不进行后面的逻辑处理,这样返回秒杀失败也合情合理

from jseckill.

Related Issues (18)

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.