You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mesos.apache.org by Tom Arnfeld <to...@duedil.com> on 2015/05/01 11:23:33 UTC

Re: Design doc for Mesos HTTP API

Thanks for sharing this Vinod, very clear and useful document!




Q: Could you explain in a little detail why the decision was made to use a single HTTP endpoint rather than something like /event (for the stream) and /call for making calls? It seems a little strange / contrived to me that the difference between sending data to the master and receiving a stream of events would be based on the order of the calls and via the same endpoint. For example, would there not be a failure case here where the initial HTTP connection (SUBSCRIBE) fails (perhaps due to application error) and the driver continue making subsequent POST requests to send messages? In this situation, what would happen? Would the next http request that sent a message start getting streamed events in the response?




Perhaps i've misread another section of the document that explains this, but it'd be great if you could help me understand.



--


Tom Arnfeld

Developer // DueDil






On Thursday, Apr 30, 2015 at 10:26 pm, Vinod Kone <vi...@gmail.com>, wrote:


	
		
			Welcome to the Greater Anglia Wi-Fi Service
		
			
				
			

			Home

				Tickets & Fares

				Travel Information

				Offers

				Destinations

				About Us

				Contact Us

			

		
		
		
		
			
				
				Map

					

				

				
			
			
			
			
			

			
			
				
					
						You are now connected
					
					


				
					Welcome to the Wi-Fi Service
					
					
						Wireless Internet access is available free for all First Class Customers and to all Standard Class Customers upon payment of a small fee. 
						


						In order to use the service you will need to complete a one time registration. Thereafter you can log on simply by entering your email address in the box below and, for Standard Customers, selecting the time period you want to purchase. 
						


						Wireless Internet access is not available in the Quiet Coach.
						



				

				
					
						Error
					
					
						
							An unexpected error has occurred
						
						An unexpected error has occurred, please contact the Wi-Fi Support Team on 0845 193 0138 for further information and assistance.
	
					

					
						
							Communication error
						
						An error occurred while contacting the authentication server. Please contact the Wi-Fi Support Team on 0845 193 0138 for further information and assistance, or try again later.
	
					

					
						
							An unexpected error has occurred
						
						An unexpected error has occurred, please contact the Wi-Fi Support Team on 0845 193 0138 for further information and assistance.
	
					

					
						
							Invalid code
						
						The code you provided is invalid. Please contact the Wi-Fi Support Team on 0845 193 0138 for further information and assistance.
	
					

					
						
							Expired code
						
						The code you provided has expired. Please contact the Wi-Fi Support Team on 0845 193 0138 for further information and assistance.
	
					

					
						
							Already logged in
						
						The code is currently in use by another user. Please contact the Wi-Fi Support Team on 0845 193 0138 for further information and assistance.
	
					

					
						
							An unexpected error has occurred
						
						An unexpected error has occurred, please contact the Wi-Fi Support Team on 0845 193 0138 for further information and assistance.
	
						
					

					
						
							An unexpected error has occurred
						
						An unexpected error has occurred, please contact the Wi-Fi Support Team on 0845 193 0138 for further information and assistance.
	
					

					
 For reference, the error code is: 



					
						Try again
					
						
				

				
				
					




				

				 
					
						
							
								Line updates (0) 
								Cancellations (0) 
								Service updates (0)
								Formation updates (0) 
								Catering updates (0) 
								London Underground updates (0) 
							

							

						

					

				
				

				 
					
					
						My Journey Details 

					
						
						
									Station
									Scheduled Arrival
									Expected Arrival	
								


				

			
  
			
			
				
					Sign In
					 
						
						Email address
						

						
							

							Need to Register? Sign-up now

						
						
	
						
				
				
				User Guide
				View realtime information
				
				
					Support
					If you require any assistance please download the user guide or contact our Wi-Fi Support Team on 0845 193 0138 or you can email your query to ga.support@icomera.com.

					Support info
					
System ID: 


						
Your IP: 


						
Your MAC: 


					

			

				
		

		
		

		
		
			
				Powered by Icomera

				

		

		
			
				
					Wi-Fi Terms and Conditions

						Wi-Fi Pricing Terms

						Privacy Policy

						© 2012 Greater Anglia

Re: Design doc for Mesos HTTP API

Posted by Vinod Kone <vi...@apache.org>.
On Fri, May 1, 2015 at 2:23 AM, Tom Arnfeld <to...@duedil.com> wrote:

> Q: Could you explain in a little detail why the decision was made to use a
> single HTTP endpoint rather than something like */event* (for the stream)
> and */call* for making calls? It seems a little strange / contrived to me
> that the difference between sending data to the master and receiving a
> stream of events would be based on the order of the calls and via the same
> endpoint. For example, would there not be a failure case here where the
> initial HTTP connection (*SUBSCRIBE*) fails (perhaps due to application
> error) and the driver continue making subsequent POST requests to send
> messages? In this situation, what would happen? Would the next http request
> that sent a message start getting streamed events in the response?
>


The initial design did include two endpoints (/call and /events) but we
decided to merge them into single endpoint for a few reasons:

--> With the two endpoints design, the SUBSCRIBE "call" had to go to the
"/events" endpoint whereas all the other calls had to go to the "/call"
endpoint. This is because all the other calls to "/call" elicited a "202
Accepted" and having SUBSCRIBE be the only call on "/call" that elicits a
"200 OK with framework id in the body" was weird. Also, it was unintuitive
when looking at the protobufs in scheduler.proto.

--> More importantly, having two different HTTP end points did nothing to
tell the client (scheduler) that it has to use two different connections.
Note that a scheduler could have very well used a single connection to talk
to two different http endpoints on the master, if it didn't know better.

--> Most HTTP clients (that I looked at) default to using a different
connection with each request anyway to avoid pipelining and head of line
blocking issues. So programming against a single endpoint should be
friendly.

--> Note that irrespective of whether it is a single endpoint or two
endpoints, the client has to make sure that it first SUBSCRIBEs before it
makes any other calls; otherwise master will return "403 Forbidden". Only
the SUBSCRIBE call will get a streaming response.

--> Having a single endpoint lends itself to easily support HTTP/2 and
websockets in the future because they support multiplexing on a single
endpoint/connection.

HTH,

Re: Design doc for Mesos HTTP API

Posted by Vinod Kone <vi...@apache.org>.
On Fri, May 1, 2015 at 2:23 AM, Tom Arnfeld <to...@duedil.com> wrote:

> Q: Could you explain in a little detail why the decision was made to use a
> single HTTP endpoint rather than something like */event* (for the stream)
> and */call* for making calls? It seems a little strange / contrived to me
> that the difference between sending data to the master and receiving a
> stream of events would be based on the order of the calls and via the same
> endpoint. For example, would there not be a failure case here where the
> initial HTTP connection (*SUBSCRIBE*) fails (perhaps due to application
> error) and the driver continue making subsequent POST requests to send
> messages? In this situation, what would happen? Would the next http request
> that sent a message start getting streamed events in the response?
>


The initial design did include two endpoints (/call and /events) but we
decided to merge them into single endpoint for a few reasons:

--> With the two endpoints design, the SUBSCRIBE "call" had to go to the
"/events" endpoint whereas all the other calls had to go to the "/call"
endpoint. This is because all the other calls to "/call" elicited a "202
Accepted" and having SUBSCRIBE be the only call on "/call" that elicits a
"200 OK with framework id in the body" was weird. Also, it was unintuitive
when looking at the protobufs in scheduler.proto.

--> More importantly, having two different HTTP end points did nothing to
tell the client (scheduler) that it has to use two different connections.
Note that a scheduler could have very well used a single connection to talk
to two different http endpoints on the master, if it didn't know better.

--> Most HTTP clients (that I looked at) default to using a different
connection with each request anyway to avoid pipelining and head of line
blocking issues. So programming against a single endpoint should be
friendly.

--> Note that irrespective of whether it is a single endpoint or two
endpoints, the client has to make sure that it first SUBSCRIBEs before it
makes any other calls; otherwise master will return "403 Forbidden". Only
the SUBSCRIBE call will get a streaming response.

--> Having a single endpoint lends itself to easily support HTTP/2 and
websockets in the future because they support multiplexing on a single
endpoint/connection.

HTH,

Re: Design doc for Mesos HTTP API

Posted by Isabel Jimenez <co...@gmail.com>.
Hi Tom,

If the initial subscription HTTP connection fails the scheduler will not be
'subscribed' ( or its old equivalent : 'registered' ) so it won't be
possible to continue making other POST requests. Please refer to the
disconnections part of the doc for more details on already 'subscribed'
schedulers :
https://docs.google.com/document/d/1pnIY_HckimKNvpqhKRhbc9eSItWNFT-priXh_urR-T0/edit#heading=h.u44zrm937tb2


On Fri, May 1, 2015 at 2:23 AM, Tom Arnfeld <to...@duedil.com> wrote:

>  Thanks for sharing this Vinod, very clear and useful document!
>
> Q: Could you explain in a little detail why the decision was made to use a
> single HTTP endpoint rather than something like */event* (for the stream)
> and */call* for making calls? It seems a little strange / contrived to me
> that the difference between sending data to the master and receiving a
> stream of events would be based on the order of the calls and via the same
> endpoint. For example, would there not be a failure case here where the
> initial HTTP connection (*SUBSCRIBE*) fails (perhaps due to application
> error) and the driver continue making subsequent POST requests to send
> messages? In this situation, what would happen? Would the next http request
> that sent a message start getting streamed events in the response?
>
> Perhaps i've misread another section of the document that explains this,
> but it'd be great if you could help me understand.
>
> --
>
> Tom Arnfeld
> Developer // DueDil
>
> On Thursday, Apr 30, 2015 at 10:26 pm, Vinod Kone <vi...@gmail.com>,
> wrote:
>
>>  [image: ga-logo] <http://www.greateranglia.co.uk>
>>
>>    - Home <http://www.greateranglia.co.uk/home>
>>    - Tickets & Fares <http://www.greateranglia.co.uk/tickets-fares>
>>    - Travel Information
>>    <http://www.greateranglia.co.uk/travel-information>
>>    - Offers <http://www.greateranglia.co.uk/offers>
>>    - Destinations <http://www.greateranglia.co.uk/destinations>
>>    - About Us <http://www.greateranglia.co.uk/about-us>
>>    - Contact Us <http://www.greateranglia.co.uk/contact-us>
>>
>>   Map
>>    You are now connected
>>  Welcome to the Wi-Fi Service
>>
>> Wireless Internet access is available free for all First Class Customers
>> and to all Standard Class Customers upon payment of a small fee.
>>
>> In order to use the service you will need to complete a one time
>> registration. Thereafter you can log on simply by entering your email
>> address in the box below and, for Standard Customers, selecting the time
>> period you want to purchase.
>>
>> Wireless Internet access is not available in the Quiet Coach.
>>
>>   Error
>>  An unexpected error has occurred
>>
>> An unexpected error has occurred, please contact the Wi-Fi Support Team
>> on *0845 193 0138* for further information and assistance.
>>   Communication error
>>
>> An error occurred while contacting the authentication server. Please
>> contact the Wi-Fi Support Team on *0845 193 0138* for further
>> information and assistance, or try again later.
>>   An unexpected error has occurred
>>
>> An unexpected error has occurred, please contact the Wi-Fi Support Team
>> on *0845 193 0138* for further information and assistance.
>>   Invalid code
>>
>> The code you provided is invalid. Please contact the Wi-Fi Support Team
>> on *0845 193 0138* for further information and assistance.
>>   Expired code
>>
>> The code you provided has expired. Please contact the Wi-Fi Support Team
>> on *0845 193 0138* for further information and assistance.
>>   Already logged in
>>
>> The code is currently in use by another user. Please contact the Wi-Fi
>> Support Team on *0845 193 0138* for further information and assistance.
>>   An unexpected error has occurred
>>
>> An unexpected error has occurred, please contact the Wi-Fi Support Team
>> on *0845 193 0138* for further information and assistance.
>>   An unexpected error has occurred
>>
>> An unexpected error has occurred, please contact the Wi-Fi Support Team
>> on *0845 193 0138* for further information and assistance.
>>
>> For reference, the error code is:
>>
>>  Try again <http://index.html>
>>   [image: Please wait...]
>>
>> Line updates (0) Cancellations (0) Service updates (0) Formation updates
>> (0) Catering updates (0) London Underground updates (0)
>>    My Journey Details   Station Scheduled Arrival Expected Arrival
>>   Sign In Email address
>>
>>  Need to Register? Sign-up now <http://form.html>
>>  User Guide <http://userguide/greateranglia_userguide.pdf> View realtime
>> information <http://www.journeycheck.com/greateranglia>
>> Support
>>
>> If you require any assistance please download the user guide
>> <http://userguide/greateranglia_userguide.pdf> or contact our Wi-Fi
>> Support Team on *0845 193 0138* or you can email your query to
>> ga.support@icomera.com. <ga...@icomera.com>
>> Support info
>>
>>    - *System ID:*
>>    - *Your IP:*
>>    - *Your MAC:*
>>
>>
>>    - Powered by Icomera <http://www.icomera.com>
>>
>>
>>    - Wi-Fi Terms and Conditions <http://terms_and_conditions.html>
>>    - Wi-Fi Pricing Terms <http://pricing_terms.html>
>>    - Privacy Policy <http://www.greateranglia.co.uk/home/privacy-policy>
>>    - © 2012 Greater Anglia
>>
>>

Re: Design doc for Mesos HTTP API

Posted by Isabel Jimenez <co...@gmail.com>.
Hi Tom,

If the initial subscription HTTP connection fails the scheduler will not be
'subscribed' ( or its old equivalent : 'registered' ) so it won't be
possible to continue making other POST requests. Please refer to the
disconnections part of the doc for more details on already 'subscribed'
schedulers :
https://docs.google.com/document/d/1pnIY_HckimKNvpqhKRhbc9eSItWNFT-priXh_urR-T0/edit#heading=h.u44zrm937tb2


On Fri, May 1, 2015 at 2:23 AM, Tom Arnfeld <to...@duedil.com> wrote:

>  Thanks for sharing this Vinod, very clear and useful document!
>
> Q: Could you explain in a little detail why the decision was made to use a
> single HTTP endpoint rather than something like */event* (for the stream)
> and */call* for making calls? It seems a little strange / contrived to me
> that the difference between sending data to the master and receiving a
> stream of events would be based on the order of the calls and via the same
> endpoint. For example, would there not be a failure case here where the
> initial HTTP connection (*SUBSCRIBE*) fails (perhaps due to application
> error) and the driver continue making subsequent POST requests to send
> messages? In this situation, what would happen? Would the next http request
> that sent a message start getting streamed events in the response?
>
> Perhaps i've misread another section of the document that explains this,
> but it'd be great if you could help me understand.
>
> --
>
> Tom Arnfeld
> Developer // DueDil
>
> On Thursday, Apr 30, 2015 at 10:26 pm, Vinod Kone <vi...@gmail.com>,
> wrote:
>
>>  [image: ga-logo] <http://www.greateranglia.co.uk>
>>
>>    - Home <http://www.greateranglia.co.uk/home>
>>    - Tickets & Fares <http://www.greateranglia.co.uk/tickets-fares>
>>    - Travel Information
>>    <http://www.greateranglia.co.uk/travel-information>
>>    - Offers <http://www.greateranglia.co.uk/offers>
>>    - Destinations <http://www.greateranglia.co.uk/destinations>
>>    - About Us <http://www.greateranglia.co.uk/about-us>
>>    - Contact Us <http://www.greateranglia.co.uk/contact-us>
>>
>>   Map
>>    You are now connected
>>  Welcome to the Wi-Fi Service
>>
>> Wireless Internet access is available free for all First Class Customers
>> and to all Standard Class Customers upon payment of a small fee.
>>
>> In order to use the service you will need to complete a one time
>> registration. Thereafter you can log on simply by entering your email
>> address in the box below and, for Standard Customers, selecting the time
>> period you want to purchase.
>>
>> Wireless Internet access is not available in the Quiet Coach.
>>
>>   Error
>>  An unexpected error has occurred
>>
>> An unexpected error has occurred, please contact the Wi-Fi Support Team
>> on *0845 193 0138* for further information and assistance.
>>   Communication error
>>
>> An error occurred while contacting the authentication server. Please
>> contact the Wi-Fi Support Team on *0845 193 0138* for further
>> information and assistance, or try again later.
>>   An unexpected error has occurred
>>
>> An unexpected error has occurred, please contact the Wi-Fi Support Team
>> on *0845 193 0138* for further information and assistance.
>>   Invalid code
>>
>> The code you provided is invalid. Please contact the Wi-Fi Support Team
>> on *0845 193 0138* for further information and assistance.
>>   Expired code
>>
>> The code you provided has expired. Please contact the Wi-Fi Support Team
>> on *0845 193 0138* for further information and assistance.
>>   Already logged in
>>
>> The code is currently in use by another user. Please contact the Wi-Fi
>> Support Team on *0845 193 0138* for further information and assistance.
>>   An unexpected error has occurred
>>
>> An unexpected error has occurred, please contact the Wi-Fi Support Team
>> on *0845 193 0138* for further information and assistance.
>>   An unexpected error has occurred
>>
>> An unexpected error has occurred, please contact the Wi-Fi Support Team
>> on *0845 193 0138* for further information and assistance.
>>
>> For reference, the error code is:
>>
>>  Try again <http://index.html>
>>   [image: Please wait...]
>>
>> Line updates (0) Cancellations (0) Service updates (0) Formation updates
>> (0) Catering updates (0) London Underground updates (0)
>>    My Journey Details   Station Scheduled Arrival Expected Arrival
>>   Sign In Email address
>>
>>  Need to Register? Sign-up now <http://form.html>
>>  User Guide <http://userguide/greateranglia_userguide.pdf> View realtime
>> information <http://www.journeycheck.com/greateranglia>
>> Support
>>
>> If you require any assistance please download the user guide
>> <http://userguide/greateranglia_userguide.pdf> or contact our Wi-Fi
>> Support Team on *0845 193 0138* or you can email your query to
>> ga.support@icomera.com. <ga...@icomera.com>
>> Support info
>>
>>    - *System ID:*
>>    - *Your IP:*
>>    - *Your MAC:*
>>
>>
>>    - Powered by Icomera <http://www.icomera.com>
>>
>>
>>    - Wi-Fi Terms and Conditions <http://terms_and_conditions.html>
>>    - Wi-Fi Pricing Terms <http://pricing_terms.html>
>>    - Privacy Policy <http://www.greateranglia.co.uk/home/privacy-policy>
>>    - © 2012 Greater Anglia
>>
>>