Skip to content

Commit

Permalink
Merge pull request #15859 from cdapio/feature/CDAP-21096_startup_probe
Browse files Browse the repository at this point in the history
[CDAP-21096] Separate bind and announce port configurations for appfabric server and processor for startupProbe
  • Loading branch information
vsethi09 authored Feb 7, 2025
2 parents ea42fd0 + 12f30fc commit 4570590
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import io.cdap.cdap.app.runtime.ProgramRuntimeService;
import io.cdap.cdap.common.conf.CConfiguration;
import io.cdap.cdap.common.conf.Constants;
import io.cdap.cdap.common.conf.Constants.AppFabric;
import io.cdap.cdap.common.conf.Constants.Service;
import io.cdap.cdap.common.conf.SConfiguration;
import io.cdap.cdap.common.discovery.ResolvingDiscoverable;
Expand Down Expand Up @@ -182,7 +183,7 @@ protected void startUp() throws Exception {
Constants.AppFabric.DEFAULT_BOSS_THREADS))
.setWorkerThreadPoolSize(cConf.getInt(Constants.AppFabric.WORKER_THREADS,
Constants.AppFabric.DEFAULT_WORKER_THREADS))
.setPort(cConf.getInt(Constants.AppFabric.SERVER_PORT));
.setPort(cConf.getInt(Constants.AppFabric.PROCESSOR_PORT));
if (sslEnabled) {
new HttpsEnabler().configureKeyStore(cConf, sConf).enable(httpServiceBuilder);
}
Expand Down Expand Up @@ -217,7 +218,7 @@ private Cancellable startHttpService(NettyHttpService httpService) throws Except

String announceAddress = cConf.get(Constants.Service.MASTER_SERVICES_ANNOUNCE_ADDRESS,
httpService.getBindAddress().getHostName());
int announcePort = cConf.getInt(Constants.AppFabric.SERVER_ANNOUNCE_PORT,
int announcePort = cConf.getInt(AppFabric.PROCESSOR_ANNOUNCE_PORT,
httpService.getBindAddress().getPort());

final InetSocketAddress socketAddress = new InetSocketAddress(announceAddress, announcePort);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -229,11 +229,18 @@ public static final class Dangerous {
*/
public static final class AppFabric {

/**
* App Fabric Processor.
*/

public static final String PROCESSOR_PORT = "appfabric.processor.bind.port";
public static final String PROCESSOR_ANNOUNCE_PORT = "appfabric.processor.announce.port";

/**
* App Fabric Server.
*/
public static final String SERVER_PORT = "app.bind.port";
public static final String SERVER_ANNOUNCE_PORT = "app.announce.port";
public static final String SERVER_PORT = "appfabric.bind.port";
public static final String SERVER_ANNOUNCE_PORT = "appfabric.announce.port";
public static final String OUTPUT_DIR = "app.output.dir";
public static final String TEMP_DIR = "app.temp.dir";
public static final String REST_PORT = "app.rest.port";
Expand Down
12 changes: 10 additions & 2 deletions cdap-common/src/main/resources/cdap-default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -514,10 +514,18 @@
</property>

<property>
<name>app.bind.port</name>
<name>appfabric.processor.bind.port</name>
<value>0</value>
<description>
App Fabric service bind port; if 0, binds to a random port
App Fabric processor bind port; if 0, binds to a random port
</description>
</property>

<property>
<name>appfabric.bind.port</name>
<value>0</value>
<description>
App Fabric server bind port; if 0, binds to a random port
</description>
</property>

Expand Down

0 comments on commit 4570590

Please sign in to comment.