druid icon indicating copy to clipboard operation
druid copied to clipboard

two PointFinder may cause port conflicts

Open QiuMM opened this issue 8 years ago • 1 comments

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.

QiuMM avatar Aug 18 '18 17:08 QiuMM

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.

QiuMM avatar Aug 18 '18 18:08 QiuMM