Skip to content

Commit

Permalink
Assign serviceNode and add volatile to the variables
Browse files Browse the repository at this point in the history
  • Loading branch information
wForget committed Feb 7, 2024
1 parent 8c3f471 commit 79aa971
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ class EtcdDiscoveryClient(conf: KyuubiConf) extends DiscoveryClient {

case class ServiceNode(path: String, lease: Long)

var client: Client = _
var kvClient: KV = _
var lockClient: Lock = _
var leaseClient: Lease = _
var serviceNode: ServiceNode = _
@volatile var client: Client = _
@volatile var kvClient: KV = _
@volatile var lockClient: Lock = _
@volatile var leaseClient: Lease = _
@volatile var serviceNode: ServiceNode = _

var leaseTTL: Long = _
@volatile var leaseTTL: Long = _

private def buildClient(): Client = {
val endpoints = conf.get(HA_ADDRESSES).split(",")
Expand Down Expand Up @@ -251,7 +251,7 @@ class EtcdDiscoveryClient(conf: KyuubiConf) extends DiscoveryClient {
val instance = serviceDiscovery.fe.connectionUrl
val watcher = new DeRegisterWatcher(instance, serviceDiscovery)

val serviceNode = createPersistentNode(
serviceNode = createPersistentNode(
conf,
namespace,
instance,
Expand Down

0 comments on commit 79aa971

Please sign in to comment.