marathon icon indicating copy to clipboard operation
marathon copied to clipboard

Feature Request: Insufficient Resource message

Open mgummelt opened this issue 11 years ago • 5 comments

Both dcos package install or dcos marathon app add make a request to POST /v2/apps. If the app requests more resources than currently available on mesos, the POST still succeeds. This might be expected if the user wants the app to deploy as soon as their are available offers, but often, the user wants to know immediately that their app will not deploy.

I propose we add an e.g. failFast option to POST /v2/apps that rejects the request if mesos doesn't have enough resources. We can query state.json for the resource allocation data.

I realize there are resource race conditions, and that even sufficient available resources doesn't guarantee deployment, but the option will help us alert users as soon as possible that we know with high likelihood that their app will not deploy.

mgummelt avatar Aug 07 '15 17:08 mgummelt

Hi @mgummelt, I do like the idea and I agree that this is user-friendly.

However, that's not how Marathon works and it would be very difficult to implement. Currently, Marathon does not keep information about current Mesos resources in its own state.

An alternative would be to block the POST call for a limited time and return status if starting failed. This would also require serious changes that will not happen any time soon.

I will keep thinking about it, maybe we can have a simple solution for that.

kolloch avatar Aug 11 '15 10:08 kolloch

Did you read my proposal for using state.json? That doesn't require saving state.

mgummelt avatar Aug 11 '15 18:08 mgummelt

Yes. I think waiting for a limited time if the deployment succeeds is better:

  • it is easy to support constraints
  • maybe if I am wrong but reading the state.json will still require some sort of interpretation by us:
    • how likely is it that Mesos offers the required resources to us etc
    • we have to apply the resource matching algorithm to fragments from the state.json
    • if we incorrectly interprete the state.json, we might incorrectly reject an application that is deployable.
  • reading state.json is fairly resource intensive on the Mesos side and blocks one of their main actors.
  • how do we deal with the race conditions?

There have been some attempts to mitigate that -- the history service, a state.json summary etc... But it will probably involve some work to make that robust and we have so many things that need attention.

kolloch avatar Aug 12 '15 12:08 kolloch

I'm not sure if it satisfies the original feature request, but would it be possible to set a threshold of deployment attempts and/or resource offers? I think it'd be a step in the right direction to automatically stop a deploy or roll back an upgrade if it's unable to succeed after N deployment attempts or M declined resource offers. Alternatively, it seems like either one of those could be time-based. It would be helpful if the insufficient resources message could be shown in the debug tab of the app. It wouldn't be an immediate response to the POST, but it would be pretty quick feedback.

aayore avatar Feb 17 '16 18:02 aayore

I believe this is covered by rejected offers.

jasongilanfarr avatar Nov 23 '16 18:11 jasongilanfarr