[go-nuts] Re: How to design HTTP request between HTTP servers

2021-03-20 Thread Van Fury
OK, if I understand you correctly, the outer for loop is not needed and that there should be two for loops. the first for loop does step 1,2 and 3 and then "break" out of the loop when valid response is received and then set the "interval". The second for loop start a for _ := range ticker.C loop

[go-nuts] Re: How to design HTTP request between HTTP servers

2021-03-20 Thread Van Fury
Hi Brian, Thanks for the reply. I intentionally left the error checks out so as to make the code short. Also using the Client.Do was an error and its suppose to be transport.Client.Do. Also in the main() does other stuff after the PUT and PATCH messages but does not have any function that is

Re: [go-nuts] Go routines stuck in runtime_pollwait

2021-03-20 Thread Rahul Yadav
Any updates, I am also facing this issue in my case Golang server just stuck and openFD gets spiked. -Rahul On Thursday, August 27, 2020 at 8:40:19 PM UTC+5:30 Siddhesh Divekar wrote: > Ok, so your data collectors never complete. A simple change to make this >> easier to diagnose is to not

Re: [go-nuts] Trying to use a tool in my build (a friction log)

2021-03-20 Thread Manlio Perillo
Il giorno venerdì 19 marzo 2021 alle 23:20:49 UTC+1 Tim Hockin ha scritto: > Thanks for feedback, comments below > > On Thu, Mar 18, 2021 at 3:35 PM Jay Conrod wrote: > >> >> > [...] > > >> *2. "writing go.mod cache" error messages* >> >> This error message should be a lot better. Sorry

[go-nuts] Re: How to design HTTP request between HTTP servers

2021-03-20 Thread Brian Candler
On Saturday, 20 March 2021 at 10:04:33 UTC Brian Candler wrote: > 2. In HandlePUTMessage you are ignoring the HTTP status code > My mistake, ignore that one. You are handling it in the caller, SendPUTMessageToServerB. -- You received this message because you are subscribed to the Google

[go-nuts] Re: How to design HTTP request between HTTP servers

2021-03-20 Thread Brian Candler
One other minor point. When you write for _ = range ticker.C { ... } then you have a timer leak if you break or return from that loop but don't call ticker.Stop(). If you only ever exit by "return" from the function, then you can simply do: ticker :=

[go-nuts] Re: How to design HTTP request between HTTP servers

2021-03-20 Thread Brian Candler
*> Any help and comments about my application design* A few general observations first: 1. In several places you are ignoring the error status, in particular at json.Unmarshal(bodybytes, ) and the error from transport.Client.Do 2. In HandlePUTMessage you are ignoring the HTTP status code 3. I

[go-nuts] How to design HTTP request between HTTP servers

2021-03-20 Thread Afriyie Abraham Kwabena
Hi, I have been learning Golang for some few months now but still find it difficult to design some applications. I have two HTTP servers A and B and would like to do the following 1. server A send an HTTP PUT request with JSON body to server B. 2. If server B is not available, server A retry