Giter VIP home page Giter VIP logo

Comments (12)

slovdahl avatar slovdahl commented on May 28, 2024

I just tried with 1.1.0.beta1 and did NOT get the same warning, so this seems to be a regression from 1.1.0.beta1.

from wasync.

jfarcand avatar jfarcand commented on May 28, 2024

Tyr configuring yourself the Options.runtime(AsyncHttpClient) and use the Options when creating the client. That should fix your issue.

from wasync.

slovdahl avatar slovdahl commented on May 28, 2024

What has changed since 1.1.0.beta1 that could cause it? Do you know what I should configure in AsyncHttpClient in order to solve it?

from wasync.

jfarcand avatar jfarcand commented on May 28, 2024

BTW, AHC (the client under the hood) doesn't use the HashedWheelTimer ... are you using Netty server side somewhere?

from wasync.

slovdahl avatar slovdahl commented on May 28, 2024

Nope, no other library than wasync (and swing) used in the project.

from wasync.

slovdahl avatar slovdahl commented on May 28, 2024

Still getting the same warning when using runtimeShared(true) with version 1.0.0-20138408.145120-16.

from wasync.

slovdahl avatar slovdahl commented on May 28, 2024

I have done some further investigation, and it seems that 3 new threads are created for every new connection.

Beta 1, 5 connections created:
beta1-threads-5-connections
Beta 1, 10 connections created:
beta1-threads-10-connections

SNAPSHOT, 5 connections created:
snapshot-threads-5-connections
SNAPSHOT, 10 connections created:
snapshot-threads-10-connections

from wasync.

jfarcand avatar jfarcand commented on May 28, 2024

Salut, I've added the following test, which open 1000 connections without any issues, and the test is inspired by your code. Which version of Netty are you using under the hood? Maybe the number of threads is caused by a change in AHC or Netty. Can you try current SNAPSHOT with the Netty's version and AHC version shipped in 1.0.0.beta? Thanks

from wasync.

slovdahl avatar slovdahl commented on May 28, 2024

A difference to my implementation is that I have the code in a Runnable and distribute the load on a few threads.

Seems like Netty 3.4.4 is used with beta1 and Netty 3.6.3 is used with RC1. I saw your tweet about 3.6.5.Final yesterday, so maybe I just need to update Netty when using RC1. But yeah, I can try using SNAPSHOT and older versions of Netty and AHC.

from wasync.

slovdahl avatar slovdahl commented on May 28, 2024

I wasn't able to build the current wasync SNAPSHOT with AHC 1.7.9 and Netty 3.4.4, something was wrong with the tests and they never finished.

from wasync.

slovdahl avatar slovdahl commented on May 28, 2024

And now I built it with AHC 1.7.12 and Netty 3.6.5.Final and still getting the warning mentioned in the first post, even when using runtimeShared(true).

from wasync.

slovdahl avatar slovdahl commented on May 28, 2024

Jeanfrancois solved the problem for me, the error was in my own code.

When creating many clients, at least AsyncHttpClient has to be shared between connections like this:

AsyncHttpClient ahc = new AsyncHttpClient();
Client client = ClientFactory.getDefault().newClient();
RequestBuilder request = client.newRequestBuilder();
request.transport(Request.TRANSPORT.WEBSOCKET);
request.method(Request.METHOD.GET);
Socket socket[] = new Socket[1000];
for (int i = 0; i < 1000; i++) {
    socket[i] = client.create(client.newOptionsBuilder().runtime(ahc).runtimeShared(true).build());
    socket[i].open(request.build());
    socket[i].fire("HELLO");
}

from wasync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.