On Tuesday, 13 September 2016 23:31:55 UTC+3, Evan Digby wrote:
>
> Hi John/Egon/Augusto,
>
> I should point out is that all we need to guarantee (barring abnormal 
> termination of course) is that once a task starts processing, it finishes. 
> Partially processed messages are bad, but http requests that don't result 
> in a message being processed at all are okay.
>
> We don't need to guarantee that the result of every Accept in the HTTP 
> server results in a processed message. We handle this on the OPS side by 
> ensuring we stop sending requests to that instance before terminating the 
> process. We just want to make sure, at that point, that the messages which 
> did make it to the handler are flushed.
>
> So the case where:
>
> h.Handle(...)  <-- gets past the closed channel check, calls go ..., butthe 
> goroutine doesn't execute yet.
> h.Close() <-- closes the close channel, Locks and Unlocks,returns.
> ...now the goroutine executes and acquires the read lock.
>
> We actually don't care if "Handle" completes in this example. We only care 
> if that our task handler starts processing a message that it completes the 
> processing.
>

How do you actually ensure that it completes processing without hooking 
into Server? I.e. that buffers and sockets get properly flushed?

Let's take a step back and what are the properties that you need -- 

I assume it's just graceful shutdown where all the pending ServeHTTP 
requests have been processed?

What should happen when the server crashes -- is it vital for those 
requests to be processed, once they have been accepted?

What should happen when one handler gets stuck in an infinite wait/loop?

Does the "Close" returning mean you exit main or does hpw does the process 
termination depend on it? Or is it just another goroutine that is 
terminating not the whole process?

+ Egon

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to