-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
DBSettings should be initialized in writeLock #1254
Comments
Could you please make a PR and provide a rationale behind this change in its description? |
0k,I wiII do it发自我的华为手机-------- 原始邮件 --------主题:Re: [ethereum/ethereumj] DBSettings should be initialized in writeLock (#1254)发件人:Mikhail Kalinin 收件人:ethereum/ethereumj 抄送:Jiawei Chan ,Author Could you please make a PR and provide a rationale behind this change in its description?
—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or mute the thread.
{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/ethereum/ethereumj","title":"ethereum/ethereumj","subtitle":"GitHub repository","main_image_url":"https://github.githubassets.com/images/email/message_cards/header.png","avatar_image_url":"https://github.githubassets.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/ethereum/ethereumj"}},"updates":{"snippets":[{"icon":"PERSON","message":"@mkalinin in #1254: Could you please make a PR and provide a rationale behind this change in its description?"}],"action":{"name":"View Issue","url":"#1254 (comment)"}}}
[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "#1254 (comment)",
"url": "#1254 (comment)",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]
|
I did it with PR #1255. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
org.ethereum.datasource.rocksdb.RocksDbDataSource#init(org.ethereum.datasource.DbSettings)
old code is:
public void init(DbSettings settings) {
(1)this.settings = settings;
(2)resetDbLock.writeLock().lock();
try {
logger.debug("~> RocksDbDataSource.init(): " + name);
but it should be like this:
public void init(DbSettings settings) {
resetDbLock.writeLock().lock();
try {
this.settings = settings;
logger.debug("~> RocksDbDataSource.init(): " + name);
For old code, if two thread(T1 and T2) call the method with different DbSettings, follow code may be wrong(T1(1)->T2(1)->T1(2)->T2(2)):
options.setMaxOpenFiles(settings.getMaxOpenFiles());
options.setIncreaseParallelism(settings.getMaxThreads());
The text was updated successfully, but these errors were encountered: