Skip to content

Conversation

@ssalinas
Copy link
Member

Found recently that most methods in SingularityMesosSchedulerImpl were all being processed on a single thread. For some things like status updates this is fine since they are then kicked over to another pool of threads. However for things like offers, we hog the thread for a while, making status updates very delayed. Let's use more than one thread....

@ssalinas ssalinas changed the title Subscribe on other Subscribe on other thread Oct 30, 2019

final Observable<Event> events = unicastEvents.share();
final Observable<Event> events = unicastEvents.share()
.subscribeOn(subscribeScheduler);
Copy link
Contributor

@baconmania baconmania Oct 30, 2019

Choose a reason for hiding this comment

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

Is there any risk in having multiple events pertaining to the same Mesos host end up on two different subscriber threads simultaneously?

Copy link
Member Author

Choose a reason for hiding this comment

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

I still need to stare at it more, but I don’t think so. Most of SchedulerImpl was written assuming it was already concurrent. Offer related traffic is behind a lock, as are any updates to state. Lost executors are mostly just logging. Status updates are a sync and behind request locks. Think that’s all?

@ssalinas
Copy link
Member Author

One additional change, gave the offer-related events and status updates separate pools. It's possible we could get 4,5,6,etc offer events backed up and still block status updates if they aren't separated

@ssalinas ssalinas changed the title Subscribe on other thread Subscribe on other thread for faster status updates Oct 31, 2019
configurable

separate status update and offer pools

subscribeOn -> observeOn

move to avoid merge conflicts
@baconmania
Copy link
Contributor

🚢

@ssalinas
Copy link
Member Author

ssalinas commented Nov 1, 2019

consolidating in #2032

@ssalinas ssalinas closed this Nov 1, 2019
@ssalinas ssalinas deleted the subscribe_on_other branch July 17, 2020 18:18
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.

3 participants