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

MemoryTransactionLogStorage重试次数更新并发问题 #75

Closed
jiang2015 opened this issue May 19, 2016 · 1 comment
Closed

MemoryTransactionLogStorage重试次数更新并发问题 #75

jiang2015 opened this issue May 19, 2016 · 1 comment

Comments

@jiang2015
Copy link
Contributor

代码
com.dangdang.ddframe.rdb.transaction.soft.storage.impl.MemoryTransactionLogStorage

方法中:
@OverRide
public void increaseAsyncDeliveryTryTimes(final String id) {
if (DATA.containsKey(id)) {
TransactionLog transactionLog = DATA.get(id);
transactionLog.setAsyncDeliveryTryTimes(transactionLog.getAsyncDeliveryTryTimes() + 1);
DATA.put(id, transactionLog);
}
}

getAsyncDeliveryTryTimes是否应该在TransactionLog 的asyncDeliveryTryTimes 加个volatile关键字,现在这种场合下,并发时,是否会有问题。

@terrymanu
Copy link
Member

会有线程安全问题。已修改。
但我们也建议不要在生产环境使用MemoryTransactionLogStorage,MemoryTransactionLogStorage仅应作为本地demo使用。

@terrymanu terrymanu changed the title MemoryTransactionLogStorage 并发的场合,是否会出问题。 [Bug] MemoryTransactionLogStorage重试次数更新并发问题 May 20, 2016
@terrymanu terrymanu changed the title [Bug] MemoryTransactionLogStorage重试次数更新并发问题 MemoryTransactionLogStorage重试次数更新并发问题 Jul 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants