Hi Sven!

Yes, this is lot of requests to a public database named GenBank through a public API called "Entrez". I repeated the test today to send you a log of what's happening. The requests are done in batches of 500 uid's because they limit/penalize huge requests. Each uid is human meta-data, I have requested 20,000 samples, and Argentina has one of the worst connections in the world.

Another problem I have is the Transcript writes everything once the exception is signaled :(
Is there a way to revert to the old behavior where each Transcript show: writes to Transcript in situ?

The ClosedConnection didn't signaled today, but OutOfMemory.

It would be nice to know how much memory was requested on startup (this is Pharo 4 on Win 8.1), because the "restart the Pharo VM with a larger memory allocation" is useless without any numbers.

Hern��n


2016-08-18 9:33 GMT-03:00 Sven Van Caekenberghe <sven@stfx.eu>:
Hi Hern��n,

If you do lots of requests (downloads) or if you download large resources (files) and you get some networking exception, all you have to do is catch it, close the connection, maybe wait a couple of seconds and try again. There is (normally) no need for any more magic, unless you found a bug.

ZnClient has some basic support for this, see #numberOfRetries[:] #retryDelay[:] #timeout[:]

Of course, I do not know exactly what you are trying to do, what the other/server end is, what code you have written, what problems you see, what you networking quality is, and so on.

Switching the socket stream implementation is only necessary in very rare cases, it is not recommended that normal users do that.

HTH,

Sven

> On 18 Aug 2016, at 06:43, Hern��n Morales Durand <hernan.morales@gmail.com> wrote:
>
> Hi,
>
> I have a situation where downloading lot of data results in ConnectionClosed.
>
> >>httpGet: urlString
>�� �� ��"Get the response from the given url"
>
>�� �� ��^ [ ... .get: urlString ]
>�� �� �� �� ��on: ZnEntityTooLarge, ConnectionClosed
>�� �� �� �� ��do: [ : ex |
>�� �� �� �� �� �� ��ex isResumable
>�� �� �� �� �� �� �� �� ��ifTrue: [ ex resume ]
>�� �� �� �� �� �� �� �� ��ifFalse: [ self handleNonResumableConnection: ex ] ].
>
> I read a mail from Sven you could change a global setting in ZnNetworkingUtils as follows:
>
> >>handleNonResumableConnection: anException
>
>�� �� ��| msg |
>�� �� ��msg :=�� 'We got a non-resumable exception while connecting to ' , self url host asString , '. Re-try switching ZdcSocketStream to SocketStream?'.
>�� �� ��(self confirm: msg)
>�� �� �� �� ��ifTrue: [
>�� �� �� �� �� �� ��ZnNetworkingUtils default socketStreamClass: SocketStream.
>�� �� �� �� �� �� ��anException retry.]
>
> But I would like to read about better handling, or recommendations.
> What do you think?
>
> Cheers,
>
> Hern��n
>
>