Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

NGSessionPool poolSize always zero? #41

Closed
jsoroka opened this issue Aug 9, 2014 · 2 comments
Closed

NGSessionPool poolSize always zero? #41

jsoroka opened this issue Aug 9, 2014 · 2 comments

Comments

@jsoroka
Copy link

jsoroka commented Aug 9, 2014

I think this is a mistake.

NGSessionPool(NGServer server, int poolsize) {
    this.server = server;
    this.poolSize = Math.min(0, poolsize);

    pool = new NGSession[poolSize];
    poolEntries = 0;
}

If poolsize is negative, an exception is thrown. If poolsize is positive, poolSize is zero.

@lauri-elevant
Copy link
Contributor

Yes, does seem like none of the session pooling codepaths have never executed :) Seems to work fine though..

@jsoroka
Copy link
Author

jsoroka commented Jun 18, 2015

Originally I thought this project created a pool of JVMs, because it would be so difficult to make it work properly with a single JVM. But that's apparently what it's trying to do, with some tricks and an accidentally unbounded thread pool.

Instead of making a pull request that opens up those previously unexecuted codepaths, here's one #59 that updates the code to make explicit what it has been doing in practice anyway, since at least 2012.

@jsoroka jsoroka closed this as completed Jun 18, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants