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

Better exposure of LB status in UI #2071

Merged
merged 9 commits into from
Feb 18, 2020
Merged

Better exposure of LB status in UI #2071

merged 9 commits into from
Feb 18, 2020

Conversation

ssalinas
Copy link
Member

The Singularity backend knows if a task has been added to the load balancer or not. We should better expose this in the health icon in the UI to show if a task is currently serving traffic or not. Still debating if this should be a separate column. Didn't want to make the active tasks table too much wider, so for the moment I've tried to see if we can encode this all into the existing health icon in a way that is easy enough to understand

Copy link
Contributor

@WH77 WH77 left a comment

Choose a reason for hiding this comment

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

few nits, but overall LGTM

@@ -364,24 +364,6 @@ public SingularityCreateResult savePendingTask(SingularityPendingTask task) {
return getChildrenAsIdsForParents("getAllTaskIds", paths, taskIdTranscoder);
}

private List<SingularityTaskId> getTaskIds(String root) {
Copy link
Contributor

Choose a reason for hiding this comment

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

were these methods unused?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah all unused

List<SingularityTaskId> notYetHealthy,
List<SingularityPendingTaskId> pending,
List<SingularityTaskId> cleaning) {
this(healthy, notYetHealthy, pending, cleaning, Collections.emptyList(), Collections.emptyList());
Copy link
Contributor

Choose a reason for hiding this comment

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

iirc you get an exception if you try to add to an emptyList(), might want to construct new lists to avoid a gotcha if this wasn't intentional

Copy link
Member Author

Choose a reason for hiding this comment

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

Was debating that, figured I'd tend towards treating as immutable. In most places in the code we try and do that, and make copies fo lists where appropriate if we are going to build on them

@@ -45,12 +45,34 @@ const ActiveTasksTable = ({request, requestId, tasksAPI, healthyTaskIds, cleanin

const tasksWithHealth = _.map(tasks, (task) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

could move this to mapStateToProps for cleanliness, but given that tasks might still be loading there I think it's fine to leave this as is

.filter(taskManager::isInLoadBalancer)
.forEach(loadBalanced::add);
cleaningTaskIds.stream()
.filter(taskManager::isInLoadBalancer)
Copy link
Contributor

Choose a reason for hiding this comment

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

does the task manager automatically update itself when tasks go in and out of the load balancer?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, the isInLoadBalancer here is a live call to fetch the state (cached on the leader in memory)

@ssalinas ssalinas added the hs_qa label Feb 12, 2020
@WH77
Copy link
Contributor

WH77 commented Feb 12, 2020

🚢

@ssalinas ssalinas merged commit 2c7eeae into master Feb 18, 2020
@ssalinas ssalinas deleted the lb_status_in_ui branch February 18, 2020 14:23
@ssalinas ssalinas added this to the 1.2.0 milestone Feb 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants