How long does it go before the timeout? Is it immediately, or something
like 60 seconds?
On Wed, Apr 25, 2012 at 11:38 PM, CW Alston <cwalsto...@gmail.com> wrote:
> Greetings, Factoristas -
>
>
> I'm looking for advice/insight on an io timeout error problem. I've built
> a couchdb 1.2.0 database,
>
> and sucessfully replicated it via curl (command line) back & forth between
> my localhost cdb instance
>
> and Cloudant and Iriscouch hosts. But when I try to POST a _replicate
> command from Factor, I've found
>
> no way to avoid an immediate closed connection and retry (terminal msg),
> followed by an I/O
>
> timeout error (listener). Looks like this:
>
>
> ! sample Factor code; starred* words just alternates of couchdb vocab
> (except set-keep-alive*)
>
> : set-keep-alive* ( request -- request ) ! pipeline fiddling with headers
>
> "keep-alive" "connection" set-header
>
> "cwalston" "password" set-basic-auth ;
>
>
> : couch-http-request* ( request -- data )
>
> set-keep-alive* ! ( -- request )
>
> dup . ! test display (see below)
>
> [ http-request ] [
>
> dup download-failed? [
>
> response>> body>> json> <couchdb-error> throw
>
> ] [
>
> rethrow
>
> ] if
>
> ] recover nip ;
>
>
> : couch-request* ( request -- assoc )
>
> couch-http-request* json> ;
>
>
> : couch-post* ( post-data url -- assoc )
>
> <post-request> couch-request* ;
>
>
> : localhost>cloudant ( -- assoc )
>
> H{
>
> { "source" "http://localhost:5984/tcm-herbarium" }
>
> { "target" "http://cwalston:passw...@cloudant.com/tcm-herbarium"
> }
>
> } <json-post-data> ! ( -- post-data )
>
> "http://localhost:5984/_replicate"
>
> couch-post* ;
>
>
> ! attempt a POST...
>
> IN: scratchpad localhost>cloudant
>
> T{ request
>
> { method "POST" }
>
> { url URL" http://localhost:5984/_replicate" }
>
> { version "1.1" }
>
> { header
>
> H{
>
> { "user-agent" "Factor http.client" }
>
> { "connection" "keep-alive" }
>
> {
>
> "Authorization"
>
> "Basic Y3dhbHN0b246b21haGFuYg=="
>
> }
>
> }
>
> }
>
> { post-data
>
> T{ post-data
>
> { data
>
> B{
>
> 123 34 115 111 117 114 99 101 34 58 34 104
>
> 116 116 112 58 47 47 108 111 99 97 108 104
>
> 111 115 116 58 53 57 56 52 47 116 99 109 45
>
> 104 101 114 98 97 114 105 117 109 34 44 34
>
> 116 97 114 103 101 116 34 58 34 104 116 116
>
> 112 58 47 47 99 119 97 108 115 116 111 110
>
> 58 111 109 97 104 97 110 98 64 99 108 111
>
> 117 100 97 110 116 46 99 111 109 47 116 99
>
> 109 45 104 ~10 more~
>
> }
>
> }
>
> { content-type "application/json" }
>
> }
>
> }
>
> { cookies V{ } }
>
> { redirects 10 }
>
> }
>
>
> IN: scratchpad
>
>
> --- Data stack:
>
> H{ { "error" "timeout" } }
>
>
> == Call stack traceback; Can't pin down the timeout source -- port,
> duplex-stream, encoder, decoder, …?
>
> (U) Quotation: [ set-namestack init-catchstack self quot>> call -> stop ]
>
> (O) Word: listener-thread
>
> (O) Word: listener
>
> (O) Word: (listener)
>
> (U) Quotation: [
>
> [ ~quotation~ dip swap ~quotation~ dip ] dip swap
>
> [ call datastack ] dip -> swap [ set-datastack ] dip
>
> ]
>
> (U) Quotation: [ call -> datastack ]
>
> (O) Word: couch-request*
>
> (O) Word: couch-http-request*
>
> (O) Word: http-request
>
> (O) Word: ( gensym )
>
> (O) Method: M\ input-port stream-read-partial-unsafe
>
> (O) Method: M\ unix (wait-to-read)
>
> (O) Word: wait-for-port
>
> (O) Word: wait-for-fd
>
> (O) Word: io-timeout
>
> (O) Method: M\ object throw
>
> (U) Quotation: [
>
> OBJ-CURRENT-THREAD special-object error-thread set-global
>
> continuation -> error-continuation set-global
>
> [ original-error set-global ] [ rethrow ] bi
>
> ]
>
> ====================
>
>
> ! === before the listener returns, I get the following terminal response:
>
> [info] [<0.13740.0>] Retrying HEAD request to https://cwalston:*****@
> cloudant.com:443/tcm-herbarium/ in 0.25 seconds due to error
> connection_closing
>
> [info] [<0.13637.0>] 127.0.0.1 - - POST /_replicate 500
>
> [error] [<0.13741.0>] ** Generic server <0.13741.0> terminating
>
> ** Last message in was {'EXIT',<0.13740.0>,killed}
>
> ** When Server state == {state,"http://localhost:5984/tcm-herbarium/
> ",20,[],
>
> [],
>
> {[],[]}}
>
> ** Reason for termination ==
>
> ** killed
>
> =ERROR REPORT==== 25-Apr-2012::22:12:07 ===
>
> ** Generic server <0.13741.0> terminating
>
> ** Last message in was {'EXIT',<0.13740.0>,killed} …etc
>
>
> ====================
>
>
> So, folks -- don't know If anyone is coding against the couchdb vocab in
> particular, but any
>
> general remarks on handling HTTP connections & I/O timeouts would be a
> boon.
>
>
> Thanks in advance,
>
> Charles Alston
>
>
> --
> *~ Memento Amori*
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk
>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk