Skip to content
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

[KYUUBI #6048] Assign serviceNode and add volatile for variables #6048

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Jesus ...

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