druid
druid copied to clipboard
two PointFinder may cause port conflicts
Currently, there are two PortFinder object in ForkingTaskRunner:
private final PortFinder portFinder;
private final PortFinder tlsPortFinder;
Although a PortFinder object is thread-safe and can guarantee no port conflicts. But there is no guarantee between two PortFinder , especially if the startPort close to tlsStartPort. What's more, IMO there is no need to have two PortFinder , one is enough.
Imagine it, if we use the portFinder to get a unused port in a thread, meanwhile use the tlsPortFinder to get a unused port in another thread. Obviously leads to potential port conflicts.