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

list类型做队列发现数据有丢失的情况 #61

Closed
boyxp opened this issue Feb 17, 2017 · 6 comments
Closed

list类型做队列发现数据有丢失的情况 #61

boyxp opened this issue Feb 17, 2017 · 6 comments

Comments

@boyxp
Copy link

boyxp commented Feb 17, 2017

环境
客户端:php 7
pika_version:2.1.4
os:Linux 2.6.32-573.26.1.el6.x86_64 x86_64

在cli下单进程插入100,000数据到list队列,lpush入rpop出,经测试顺序一致,速度也很快。

然而在web环境下,并发100时,发现队列数据有丢失。跟踪lpush确实插入成功返回值为1,但rpop时会间隔的漏掉1条、3条,不规律,总体情况是100条丢失45条左右。

不知道有么有人遇到过。

后来直接切换到redis的端口,数据正常。因此排除客户端和环境问题。

@baotiao
Copy link
Contributor

baotiao commented Feb 17, 2017

你试试并发的环境下面是不是需要加锁来做这个事情, 有没有可能是并发的时候不加锁的插入list 导致的问题

@KernelMaker
Copy link
Collaborator

pika有行锁的,有稳定复现的case吗?发一下吧

@boyxp
Copy link
Author

boyxp commented Feb 17, 2017

是pika自带的加锁?还是自己实现。我开wiki里没有相关方法😂

@KernelMaker
Copy link
Collaborator

@boyxp pika内部有行锁进行保证,不需要上层再做额外保护,如果你那边有复现case可以提供给我们,谢谢

@boyxp
Copy link
Author

boyxp commented Feb 21, 2017

用压测工具模拟并发100,持续10秒,无法复现了。

我在线上再试试

@baotiao
Copy link
Contributor

baotiao commented Feb 21, 2017

ok

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