Skip to content

Commit

Permalink
Merge pull request apache#3323, fix double-checked locking.
Browse files Browse the repository at this point in the history
  • Loading branch information
biyuhao authored and chickenlj committed Jan 24, 2019
1 parent 21a608c commit faf3983
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class MetadataReportService {

protected final Logger logger = LoggerFactory.getLogger(getClass());

private static MetadataReportService metadataReportService;
private static volatile MetadataReportService metadataReportService;
private static Object lock = new Object();

private MetadataReportFactory metadataReportFactory = ExtensionLoader.getExtensionLoader(MetadataReportFactory.class).getAdaptiveExtension();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ class MetadataReportRetry {
protected final Logger logger = LoggerFactory.getLogger(getClass());

final ScheduledExecutorService retryExecutor = Executors.newScheduledThreadPool(0, new NamedThreadFactory("DubboRegistryFailedRetryTimer", true));
ScheduledFuture retryScheduledFuture;
volatile ScheduledFuture retryScheduledFuture;
AtomicInteger retryCounter = new AtomicInteger(0);
// retry task schedule period
long retryPeriod;
Expand Down

0 comments on commit faf3983

Please sign in to comment.