Merge pull request #503 from PascalSchumacher/AbstractMQTTSocket#getProtocolConverter_race_condition

AMQ-7439: AbstractMQTTSocket#getProtocolConverter: Race condition in …
This commit is contained in:
Jean-Baptiste Onofré 2020-05-16 07:25:28 +02:00 committed by GitHub
commit d474580a34
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

View File

@ -144,8 +144,9 @@ public abstract class AbstractMQTTSocket extends TransportSupport implements MQT
if (protocolConverter == null) {
synchronized(this) {
if (protocolConverter == null) {
protocolConverter = new MQTTProtocolConverter(this, brokerService);
IntrospectionSupport.setProperties(protocolConverter, transportOptions);
MQTTProtocolConverter newProtocolConverter = new MQTTProtocolConverter(this, brokerService);
IntrospectionSupport.setProperties(newProtocolConverter, transportOptions);
protocolConverter = newProtocolConverter;
}
}
}