Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exposing the connection timeout param from library #250

Open
ankitAtVauld opened this issue Jan 6, 2022 · 1 comment
Open

exposing the connection timeout param from library #250

ankitAtVauld opened this issue Jan 6, 2022 · 1 comment

Comments

@ankitAtVauld
Copy link
Contributor

node.js version: 16

npm/yarn version: 8.3

faktory-server version: 1.6.0

facktory-worker package version: 1.6.0

Code sample:

Currently, the client.js files looks as following.

constructor(options = {}) {
        const url = new url_1.URL(options.url || FAKTORY_URL);
        this.password = options.password || querystring_1.unescape(url.password);
        this.labels = options.labels || [];
        this.wid = options.wid;
        this.connectionFactory = new connection_factory_1.ConnectionFactory({
            host: options.host || url.hostname,
            port: options.port || url.port,
            handshake: this.handshake.bind(this),
        });
        this.pool = generic_pool_1.createPool(this.connectionFactory, {
            testOnBorrow: true,
            acquireTimeoutMillis: 5000,
            idleTimeoutMillis: 10000,
            evictionRunIntervalMillis: 11000,
            min: 1,
            max: options.poolSize || 20,
            autostart: false,
        });
    }

Expected Behavior:

Is is possible to set the acquireTimeoutMillis like below:

acquireTimeoutMillis: options.acquireTimeoutMillis || 5000

This can help decide failure timeout strategies. for e.g., we might want to fail fast and set it to lower values.
Also, do you think there can be negative impacts caused by this?
If this seems reasonable, we can also raise this as a PR.

Actual Behavior:

Currently it takes quite some time before it timeout, resulting in bad API response times on our systems.

@ankitAtVauld
Copy link
Contributor Author

Could you please let us know your thoughts on above ?
appreciate that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant