orthecreedence / cl-async

Asynchronous IO library for Common Lisp.
MIT License
272 stars 40 forks source link

cl-async with-event-loop doesnt exit (hangs) when there is a future error inside it. #110

Closed nightshade427 closed 9 years ago

nightshade427 commented 9 years ago

Why does this hang when using branch using "pre libuv merge" release (cant switch over till the bugs in libuv cl-async and carrier are fixed up, see https://github.com/orthecreedence/carrier/issues/5)

CL-USER> (as:with-event-loop ()                                                                                                                                                   
            (asf:alet ((mine (carrier:request "http://nick.devs.firma8.com:8889/" :return-body t)))                                                               
              (format t "~%mine: ~s~&" mine)))                                                                                                                                    
 <INFO> [23:20:06] carrier carrier.lisp (request) -                                                                                                                               
  request: "GET /payment-required HTTP/1.1^M                                                                                                                                      
Host: nick.devs.firma8.com^M                                                                                                                                                      
^M                                                                                                                                                                                
"                                                                                                                                                                                 
 <INFO> [23:20:06] carrier carrier.lisp (request) -                                                                                                                               
  carrier error: TCP connection error: 111: Connection refused                                                                                                                    
 <INFO> [23:20:06] carrier carrier.lisp (request) - c fallback 

It hangs and doesnt exit, even though carrier triggered (signal-error) and with-event-loop should catch it and exit (it used to)

It hangs with this as well:

(as:with-event-loop ()                                                                                                                                                   
            (asf:alet ((mine (drakma-async:http-request "http://nick.devs.firma8.com:8889/")))                                                                                    
              (format t "~%mine: ~s~&" mine)))

But, this works as expected and exits the event-loop, with the same branches/releases used but using drakma instead (getting same error, the event loops returns).

(as:with-event-loop ()                                                                                                                                                   
            (asf:alet ((mine (drakma:http-request "http://nick.devs.firma8.com:8889/")))                                                                          
              (format t "~%mine: ~s~&" mine)))
nightshade427 commented 9 years ago

It looks like it does this with the latest cl-async (using libuv) as well.

It used to return from event loop when there was an error signaled, now it just hangs. :(

orthecreedence commented 9 years ago

Hey, can you try again? We made a number of changes and improvements to the error handling system in cl-async. I'm wondering if this clears things up for you.

nightshade427 commented 9 years ago

Nope still does it. I think I'm going to switch over completly to blackbird instead of continuing to use cl-async-future. Will let you know how it goes.

orthecreedence commented 9 years ago

Hey any word on this?

nightshade427 commented 9 years ago

I just tried to repo and can't. I think it's good.