Skip to content

concurrent cache bug fix#5043

Merged
chickenlj merged 1 commit intoapache:masterfrom
fakefrog:master
Nov 18, 2019
Merged

concurrent cache bug fix#5043
chickenlj merged 1 commit intoapache:masterfrom
fakefrog:master

Conversation

@fakefrog
Copy link
Copy Markdown
Contributor

What is the purpose of the change

The codes are not thread-safe,
"
ret = makeWrapper(c);
WRAPPER_MAP.put(c, ret);
"
should be replaced by
"
WRAPPER_MAP.putIfAbsent(c, makeWrapper(c));
ret = WRAPPER_MAP.get(c);
"
as the key may be put into the map twice.
Futuhermore,the codes can also be replaced by lambda expression

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission, we really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


baiyundou seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

@htynkn htynkn added the type/need-triage Need maintainers to triage label Sep 13, 2019
@chickenlj chickenlj merged commit 764b110 into apache:master Nov 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type/need-triage Need maintainers to triage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants