Fork me on GitHub
#aleph
<
2017-08-09
>
ztellman18:08:46

@aengelberg this is kind of a late reply, but there should be a default timeout, and it should never hang indefinitely

aengelberg18:08:20

I see there’s a default connection-timeout of 60000.0, but I don’t see a default request-timeout.

aengelberg18:08:29

I’m not sure what phase of my request hung.

ztellman18:08:08

it would be weird for a connection to be open for hours, usually something in between has an idle timeout

ztellman18:08:35

I will note that I've seen issues in Netty where connections close, and the notification isn't fired

aengelberg18:08:10

I don’t know if this issue will ever happen again. I already changed my code to (deref (http/get ...) 30000 ::timeout) as miikka suggested, just in case.

ztellman18:08:12

I've never been able to figure out how to reliably make it happen

ztellman18:08:20

sure, that will definitely work

ztellman18:08:42

in other Netty codebases I've added periodic checks to see if a connection is closed even though the event didn't fire

ztellman18:08:03

I should probably do the same in Aleph, even though I've tried to avoid any sort of background tasks so far

aengelberg18:08:27

My code is issuing thousands of paginated HTTP requests to load a bunch of data from a Campaign Monitor API, and pretty regularly, at least one request fails for a variety of reasons.

ztellman18:08:50

well, your workaround is sound, so this probably isn't a concern to you anymore

aengelberg18:08:09

I wrapped it with retry/backoff logic, but when the deref hung forever, my wrapper couldn’t do anything.

ztellman18:08:14

though as always, targeting the latest Netty is always a decent idea, there are lots of fixes each release

aengelberg18:08:01

glad you endorse my duct tape solution.

ztellman18:08:23

I might use manifold.deferred/timeout!, but same difference

aengelberg18:08:51

The only real potential concern is that maybe I’ll leak a connection object if I don’t wait for it to complete.

aengelberg18:08:03

But I doubt that issue will happen enough times (if at all) to make any impact.