-
Notifications
You must be signed in to change notification settings - Fork 11.6k
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
[ROCKETMQ-107] fix possible concurrency problem on ServiceState when consumer start/shutdown #68
[ROCKETMQ-107] fix possible concurrency problem on ServiceState when consumer start/shutdown #68
Conversation
1.AtomicReference state = new AtomicReference() 2.volatile can fix the problem |
@Ah39 For example, two thread may start in the same time and the the resources will be initized twice, actually the later one should be rejected, which is the problem I issue. |
apache/curator TreeCache Start |
2 similar comments
2 similar comments
2 similar comments
2 similar comments
@Ah39 |
IMO, consider that please @lizhanhui @shroman help review at your convenience. |
I also think that using
private volatile ServiceState serviceState;
And, of course, provide comments to public methods ;) |
2 similar comments
As pointed out, I agree marking shutdown and start |
@Jaskey Could you continue to polish this PR as we have pointed out :-) |
Do all guys consider makeing method synchrinized which is locking the consumer object is a better way instead of a more fine-grained lock. If so, I will do the following changes:
|
Probably you don't want to synchronize |
@shroman If thread B is setting the state as SHUTDOWN_AREADY afterwards, thread A 's |
…consumer start/shutdown
2 similar comments
2 similar comments
@Jaskey I agree that |
@lizhanhui @zhouxinyu @shroman |
Merged, thanks @Jaskey , please help close this PR. |
…consumer start/shutdown, closes #68
Thank you @zhouxinyu |
…consumer start/shutdown, closes #68
…consumer start/shutdown, closes apache#68
…consumer start/shutdown, closes apache#68
当新复制关闭时,返回maxOffset
JIRA: https://issues.apache.org/jira/browse/ROCKETMQ-107
No Syncrinations in start or shutdown which may result in :
Implemenations:
start
andshutdown