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

Added thread names to commons commmand executor threads #729

Merged
merged 1 commit into from
Jan 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,14 @@ public enum RpcType {
SOCKET_RPC
}

private static final Duration RESULT_TIMEOUT = Duration.ofSeconds(20);
private static final Duration WATCHDOG_TIMEOUT = Duration.ofSeconds(30);
private static final AtomicInteger sequence = new AtomicInteger(1000);
private static final Pattern BSN_PATTERN = Pattern.compile("\\s*([^;\\s]+).*");
public static final String PROPERTY_ENABLE_LOGGING = "osgi.fx.enable.logging";
public static final String PROPERTY_ENABLE_EVENTING = "osgi.fx.enable.eventing";
private static final Duration RESULT_TIMEOUT = Duration.ofSeconds(20);
private static final Duration WATCHDOG_TIMEOUT = Duration.ofSeconds(30);
private static final AtomicInteger sequence = new AtomicInteger(1000);
private static final Pattern BSN_PATTERN = Pattern.compile("\\s*([^;\\s]+).*");
public static final String PROPERTY_ENABLE_LOGGING = "osgi.fx.enable.logging";
public static final String PROPERTY_ENABLE_EVENTING = "osgi.fx.enable.eventing";
private static final String COMMAND_EXECUTOR_DEFAULT_THREAD_NAME = "exec-default";
private static final String COMMAND_EXECUTOR_WATCHDOG_THREAD_NAME = "exec-watchdog";

public volatile boolean quit;
private final RpcType rpcType;
Expand Down Expand Up @@ -405,8 +407,9 @@ public String execCliCommand(final String command) {
}
final DefaultExecuteResultHandler resultHandler = new DefaultExecuteResultHandler();
final ExecuteWatchdog watchdog = ExecuteWatchdog.builder().setTimeout(WATCHDOG_TIMEOUT)
.get();
final Executor executor = DefaultExecutor.builder().get();
.setThreadFactory(r -> new Thread(r, COMMAND_EXECUTOR_WATCHDOG_THREAD_NAME)).get();
final Executor executor = DefaultExecutor.builder()
.setThreadFactory(r -> new Thread(r, COMMAND_EXECUTOR_DEFAULT_THREAD_NAME)).get();
final ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
final PumpStreamHandler streamHandler = new PumpStreamHandler(outputStream);

Expand Down
Loading