<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr">On Sun, Oct 28, 2018, 17:55 Levente Uzonyi <<a href="mailto:leves@caesar.elte.hu" target="_blank">leves@caesar.elte.hu</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi Chris,<br>
<br>
On Sun, 28 Oct 2018, Chris Cunningham wrote:<br>
<br>
> Hi.<br>
> I was loading the VMMaker package(s), and after manually opening the debugger and restarting at #httpGet:do: about 10 times, I implemented this hack so that I didn't have to do that anymore.<br>
> <br>
> I *think* this is fixing the issue - haven't had it raise errors while 'timing out' on loading packages since this (the timeout were sub-second - the connection hadn't gone through yet).  Still, it<br>
> might just be timing - this isn't really a repeatable bug.<br>
<br>
I'm sure this change helps with that issue, but it has unwelcome side <br>
effects to WebClient's other users.<br></blockquote><div>This this definitely will not be going to trunk.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
The real solution would be to fix the server.<br>
<br>
Where did you see sub-second timeouts? The default timeout should be 45 <br>
seconds.<br></blockquote></div></div><div>It didn't wait 45 seconds - it is almost instantaneous for me.  The error received back (from Socket>>sendSomeData:startIndex:count:for: ) is "ConnectionTimedOut: send data timeout; data not sent", but I'm pretty darn certain it is that the socket isn't yet connected (trace put into Socket>>waitForSendDoneFor: confirms this).  Looking at #waitForSendDoneFor: shows that before any wait, it checks if the socket is connected - if not, it immediately exits with false, which triggers the time out error in the caller.</div><div><br></div><div>If I trap it and immediately resend, then it works.  Weird.</div><div><br></div><div>-cbc </div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
> <br>
> Not in Trunk because it is definitely a hack - but it makes things work nicer.<br>
> <br>
> Also, committing packages to the inbox with this loaded doesn't result in walkbacks (from timeouts and whatnot) for me.  Although it does take a long time to finish.<br>
<br>
Uploads use PUT requests, so expect to still see walkbacks there.<br>
<br>
Levente<br>
<br>
> <br>
> -cbc<br>
> <br>
> On Sun, Oct 28, 2018 at 5:08 PM <<a href="mailto:commits@source.squeak.org" rel="noreferrer" target="_blank">commits@source.squeak.org</a>> wrote:<br>
>       A new version of WebClient-Core was added to project The Inbox:<br>
>       <a href="http://source.squeak.org/inbox/WebClient-Core-cbc.118.mcz" rel="noreferrer noreferrer" target="_blank">http://source.squeak.org/inbox/WebClient-Core-cbc.118.mcz</a><br>
><br>
>       ==================== Summary ====================<br>
><br>
>       Name: WebClient-Core-cbc.118<br>
>       Author: cbc<br>
>       Time: 28 October 2018, 5:08:23.571079 pm<br>
>       UUID: 683fbe3b-418f-a443-9a20-3f2a7af4b7e1<br>
>       Ancestors: WebClient-Core-pre.117<br>
><br>
>       A hack to work around connectionTimedOut annoyances when opening packages from Trunk (sometimes).<br>
><br>
>       =============== Diff against WebClient-Core-pre.117 ===============<br>
><br>
>       Item was changed:<br>
>         ----- Method: WebClient>>httpGet:do: (in category 'methods') -----<br>
>         httpGet: urlString do: aBlock<br>
>               "GET the response from the given url"<br>
>               "(WebClient httpGet: '<a href="http://www.squeak.org" rel="noreferrer noreferrer" target="_blank">http://www.squeak.org</a>') content"<br>
><br>
>       +       | request errCount |<br>
>       -       | request |<br>
>               self initializeFromUrl: urlString.<br>
>               request := self requestWithUrl: urlString.<br>
>               request method: 'GET'.<br>
>               userAgent ifNotNil:[:ua | request headerAt: 'User-Agent' put: ua].<br>
>               self contentDecoders ifNotNil: [:decoders | request headerAt: 'Accept-Encoding' put: decoders].<br>
>       +<br>
>       +       errCount := 0. "Let's try resending to get around 'connection issues' trunk connections"<br>
>       +       [<br>
>       +               aBlock value: request.<br>
>       +               ^self sendRequest: request<br>
>       +       ] on: Error, NetworkError do: [:e| debugLog ifNotNil: [debugLog cr; nextPutAll: 'httpGet error: ', e; flush]. (errCount := errCount + 1) > 3 ifTrue: [e outer]. e retry].!<br>
>       -       aBlock value: request.<br>
>       -       ^self sendRequest: request<br>
>       - !<br>
> <br>
> <br>
> <br>
><br>
</blockquote></div></div></div>
</div></div></div></div>