Make call SchedulerServer::new once in ballista-scheduler process#1537
Make call SchedulerServer::new once in ballista-scheduler process#1537alamb merged 3 commits intoapache:masterfrom
Conversation
ballista/rust/scheduler/src/main.rs
Outdated
| "Ballista v{} Scheduler listening on {:?}", | ||
| BALLISTA_VERSION, addr | ||
| ); | ||
| //there should be only one SchedulerServer in process |
There was a problem hiding this comment.
I don't understand how this code ensures just one SchedulerServer exists per process.
It seems to me what this code does is create a new SchedulerServer on a port that the operating system picks.
There was a problem hiding this comment.
Perhaps using something like lazy_static (https://docs.rs/lazy_static/1.4.0/lazy_static/, already a dependency) might be worth looking into
There was a problem hiding this comment.
Thanks, sorry for my wrong annotation. it should be only call SchedulerServer::new() once in process ,
is this right ?
There was a problem hiding this comment.
its ok to clone() SchedulerServer in multi-thread without call tokio::spawn(async move { state_clone.synchronize_job_status_loop().await });
There was a problem hiding this comment.
SchedulerServer::new creates the scheduler loop that runs in the background, that's the thing that's causing the issue.
There was a problem hiding this comment.
Sorry -- I don't really know what this code is doing, so I just had an uninformed question; Sorry if this delayed merging unnecessarily.
|
If it fixes your issues @Ted-Jiang then it sounds good to me 👍 |
Which issue does this PR close?
Closes #1531 .
avoid
tokio::spawn(async move { state_clone.synchronize_job_status_loop().multi-times