Hi Tim,
As you probably know it is a struggle to make background threads
cooperate with sbt's interactive mode, especially when working with
underlying java libraries that do not have this concern. In Dispatch
0.9.3 [1] I weeded out every background thread I could find and made it
daemon, which did the trick for typcial operation.
I would guess that this class is spinning off a thread:
com.ning.http.client.ProxyServer
[1]:
http://notes.implicit.ly/post/34495822045/dispatch-0-9-3
Nathan
On 01/29/2013 06:17 PM, Timothy Perrett wrote:
> And oh, this *only* happens when I use a proxy with the following
> configuration:
>
> import
> com.ning.http.client.{Response,ProxyServer,AsyncHttpClientConfig},
> AsyncHttpClientConfig.Builder
>
> private def withProxy(b: Builder): Builder =
> (for {
> host <- Option(System.getenv("proxy_host"))
> port <- Option(System.getenv("proxy_port")).map(_.toInt)
> } yield b.setProxyServer(new ProxyServer(host, port))).getOrElse(b)
>
> // later
> Http.configure(withProxy)(url(resource) OK handler).either
>
> On Tuesday, 29 January 2013 15:14:23 UTC-8, Timothy Perrett wrote:
>
> Hey guys,
>
> I'm seeing this notice when my application exits:
> AsyncHttpClient.close() hasn't been invoked, which may produce file
> descriptor leaks
>
> If I execute in the SBT shell, it continues to spit out things like:
>
> [DEBUG] Entry count for :
http://myurl.com : 1
> [DEBUG] Adding Candidate Idle Channel [id: 0x42c505f7,
> /<someip>:59334 => <
myurl.com <
http://myurl.com>>/<myip>:<myport>]
> [DEBUG] Closing Idle Channel [id: 0x42c505f7, /<someip>:59334
> => <
myurl.com <
http://myurl.com>>/<myip>:<myport>]
> [DEBUG] Channel Closed: [id: 0x42c505f7, /<someip>:59334
> :> <
myurl.com <
http://myurl.com>>/<myip>:<myport>] with attachment
> com.ning.http.client.providers.netty.NettyAsyncHttpProvider$DiscardEvent@7fcaa2ba
> [DEBUG] Entry count for :
http://myurl.com : 0
> [DEBUG] Entry count for :
http://myurl.com : 0
> [DEBUG] Entry count for :
http://myurl.com : 0
>
> And it just continues to spit out those logs if I leave the shell
> running. I can press enter at any time and continue working, but it
> indicates there are still some threads running in the background.
> I've tried to clean up explicitly using dispatch.Http.shutdown() but
> that actually seems to make matters worse, as the application then
> blocks and wont let me hit enter to continue working.
>
> I cant think how else I can shut this down? Looking at the
> async-http-client source it seems dispatch already calls its close
> method internally...
>
> Thoughts?
>
> Cheers, Tim
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "Dispatch" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to
dispatch-scal...@googlegroups.com.
> For more options, visit
https://groups.google.com/groups/opt_out.
>
>