[Openmcl-devel] Unexpeted behaviour when running Hunchentoot example on windows

Gary Byers gb at clozure.com
Sun Feb 14 17:36:10 PST 2010


I'm not sure if this is the problem, but ...

The documentation says that the values of the :connect-timeout,
:input-timeout, and :output-timeout arguments to MAKE-SOCKET are
expressed in seconds.  That would be consistent with the values
returned by STREAM-INPUT-TIMEOUT and friends, but MAKE-SOCKET's
timeout argument values are just passed through to lower-level
code that expects to use values expressed in milliseconds.

So, a read from something like:

(make-socket ... :input-timeout 5)

will time out if no data's available after 5 milliseconds; the
documentation suggests that that should wait for 5 seconds before
giving up.

As far as I know, that bug/discrepancy has been there since the
timeout options were added (2+ years ago); if people have been
using timeouts, they may have been working around this.  If the
workaround involves something like:

(let* ((s (make-socket ...)))
   (setf (socket-input-timeout s) 5)
   s)

that's fine.  If the workaround involves something like:

(make-socket ... :input-timeout 5000)

... well, it's probably better to make the implementation match what
the documentation says even if it breaks a workaround like this.



On Sun, 14 Feb 2010, Allan Dee wrote:

> This is a vague description, and might be the wrong place to go with
> it, I'm trying it in case it's already known - no time tonight to
> investigate properly.
>
> I do this:
>
> Welcome to Clozure Common Lisp Version 1.4-r13122  (WindowsX8664)!
> ? (asdf:oos 'asdf:load-op :hunchentoot)
> #<LOAD-OP NIL #x14137D93D>
> ? (setq hunchentoot:*catch-errors-p* nil)
> ? NIL
> ? (hunchentoot:start (make-instance 'hunchentoot:acceptor :port 4242))
> ? #<ACCEPTOR (host *, port 4242)>
> ?
>
> when I point a browser to <http://localhost:4242> the default page is
> served as expected.  However, after a few seconds (I guess
> corresponding to a timeout-setting somewhere), I get the
> error/backtrace at the end of this mail.
>
> The server keeps responding, but every request eventually triggers this error.
>
> For comparison, I've tried with a couple of other
> Lisp-implementations, with the same libraries, and they don't exhibit
> this behaviour.
>
> Any ideas?
>
>
>
>> Debug: Error #<USOCKET:TIMEOUT-ERROR #x143156F3D>
>> While executing: SIGNAL, in process Hunchentoot worker (client: 127.0.0.1:54449)(3).
>
>
> ;;;
> ;;; #<PROCESS Hunchentoot worker (client: 127.0.0.1:54449)(3) [Active]
> #x14313A45D> requires access to Shared Terminal Input
> ;;; Type (:y 3) to yield control to this thread.
> ;;;
> :y 3
>
>
> ;;;
> ;;; Shared Terminal Input is now owned by #<PROCESS Hunchentoot worker
> (client: 127.0.0.1:54449)(3) [Active] #x14313A45D>
> ;;;
>
>> Type :POP to abort, :R for a list of available restarts.
>> Type :? for other options.
> 1 > :b
> (37B0840) : 0 (SIGNAL #<USOCKET:TIMEOUT-ERROR #x143156F3D>) 973
> (37B0898) : 1 (%ERROR #<USOCKET:TIMEOUT-ERROR #x143156F3D> (:SOCKET
> NIL) 7299352) 117
> (37B08C0) : 2 (HANDLE-CONDITION #<INPUT-TIMEOUT #x14315722D> NIL) 237
> (37B08F0) : 3 (SIGNAL #<INPUT-TIMEOUT #x14315722D>) 973
> (37B0948) : 4 (%ERROR #<INPUT-TIMEOUT #x14315722D> (:STREAM
> #<BASIC-TCP-STREAM ISO-8859-1 (SOCKET/1016) #x14313C19D>) 7299374) 117
> (37B0970) : 5 (FD-STREAM-ADVANCE #<BASIC-TCP-STREAM ISO-8859-1
> (SOCKET/1016) #x14313C19D> #S(CCL::IOBLOCK :STREAM #<BASIC-TCP-STREAM
> ISO-8859-1 (SOCKET/1016) #x14313C19D> :UNTYI-CHAR NIL ...) T) 869
> (37B09E8) : 6 (%IOBLOCK-READ-U8-BYTE #S(CCL::IOBLOCK :STREAM
> #<BASIC-TCP-STREAM ISO-8859-1 (SOCKET/1016) #x14313C19D> :UNTYI-CHAR
> NIL ...)) 221
> (37B0A28) : 7 (READ-BYTE #<BASIC-TCP-STREAM ISO-8859-1 (SOCKET/1016)
> #x14313C19D> NIL NIL) 277
> (37B0A80) : 8 (READ-CHAR* #<BASIC-TCP-STREAM ISO-8859-1 (SOCKET/1016)
> #x14313C19D> NIL NIL) 173
> (37B0AB0) : 9 (READ-LINE* #<BASIC-TCP-STREAM ISO-8859-1 (SOCKET/1016)
> #x14313C19D> NIL) 213
> (37B0B20) : 10 (READ-INITIAL-REQUEST-LINE #<BASIC-TCP-STREAM
> ISO-8859-1 (SOCKET/1016) #x14313C19D>) 653
> (37B0BC8) : 11 (GET-REQUEST-DATA #<BASIC-TCP-STREAM ISO-8859-1
> (SOCKET/1016) #x14313C19D>) 85
> (37B0C08) : 12 (FUNCALL #'#<#<STANDARD-METHOD
> HUNCHENTOOT:PROCESS-CONNECTION (HUNCHENTOOT:ACCEPTOR T)>> #<ACCEPTOR
> (host *, port 4242)> #<USOCKET:STREAM-USOCKET #x14313B85D>) 1253
> (37B0CC0) : 13 (%CALL-NEXT-METHOD (NIL #<STANDARD-METHOD
> HUNCHENTOOT:PROCESS-CONNECTION #> . 7299532)) 1021
> (37B0D58) : 14 (FUNCALL #'#<#<STANDARD-METHOD
> HUNCHENTOOT:PROCESS-CONNECTION :AROUND (HUNCHENTOOT:ACCEPTOR T)>>
> #<ACCEPTOR (host *, port 4242)> #<USOCKET:STREAM-USOCKET #x14313B85D>)
> 661
> (37B0DF0) : 15 (%%STANDARD-COMBINED-METHOD-DCODE (#<STANDARD-METHOD
> HUNCHENTOOT:PROCESS-CONNECTION :AROUND #> #<STANDARD-METHOD
> HUNCHENTOOT:PROCESS-CONNECTION #>) 7299532) 709
> (37B0E78) : 16 (FUNCALL #'#<(:INTERNAL
> BORDEAUX-THREADS::BINDING-DEFAULT-SPECIALS)>) 773
> (37B0EB8) : 17 (RUN-PROCESS-INITIAL-FORM #<PROCESS Hunchentoot worker
> (client: 127.0.0.1:54449)(3) [Active] #x14313A45D>
> (#<COMPILED-LEXICAL-CLOSURE # #x14313A1DF>)) 685
> (37B0F48) : 18 (FUNCALL #'#<(:INTERNAL (CCL::%PROCESS-PRESET-INTERNAL
> (PROCESS)))> #<PROCESS Hunchentoot worker (client: 127.0.0.1:54449)(3)
> [Active] #x14313A45D> (#<COMPILED-LEXICAL-CLOSURE # #x14313A1DF>)) 389
> (37B0F98) : 19 (FUNCALL #'#<(:INTERNAL CCL::THREAD-MAKE-STARTUP-FUNCTION)>) 301
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
>



More information about the Openmcl-devel mailing list