Skip to content

Commit

Permalink
Fail connection manager workflow on non-deterministic exception (#14758)
Browse files Browse the repository at this point in the history
* fail connection manager workflow on non-deterministic exception

* Update where the config is added

Co-authored-by: Benoit Moriceau <benoit@airbyte.io>
  • Loading branch information
lmossman and benmoriceau committed Oct 3, 2022
1 parent eb14f49 commit 2345971
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,7 @@
},
{
"title": "verify-full",
"required": [
"mode",
"ca_certificate",
"client_certificate",
"client_key"
],
"required": ["mode", "ca_certificate", "client_certificate", "client_key"],
"properties": {
"mode": {
"enum": ["verify-full"],
Expand Down Expand Up @@ -223,13 +218,7 @@
},
{
"title": "SSH Key Authentication",
"required": [
"tunnel_method",
"tunnel_host",
"tunnel_port",
"tunnel_user",
"ssh_key"
],
"required": ["tunnel_method", "tunnel_host", "tunnel_port", "tunnel_user", "ssh_key"],
"properties": {
"ssh_key": {
"type": "string",
Expand Down Expand Up @@ -271,13 +260,7 @@
},
{
"title": "Password Authentication",
"required": [
"tunnel_method",
"tunnel_host",
"tunnel_port",
"tunnel_user",
"tunnel_user_password"
],
"required": ["tunnel_method", "tunnel_host", "tunnel_port", "tunnel_user", "tunnel_user_password"],
"properties": {
"tunnel_host": {
"type": "string",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@
import io.micronaut.discovery.event.ServiceReadyEvent;
import io.micronaut.scheduling.TaskExecutors;
import io.temporal.serviceclient.WorkflowServiceStubs;
import io.temporal.worker.NonDeterministicException;
import io.temporal.worker.Worker;
import io.temporal.worker.WorkerFactory;
import io.temporal.worker.WorkerOptions;
import io.temporal.worker.WorkflowImplementationOptions;
import jakarta.inject.Inject;
import jakarta.inject.Named;
import jakarta.inject.Singleton;
Expand Down Expand Up @@ -243,8 +245,10 @@ private void registerCheckConnection(final WorkerFactory factory, final MaxWorke
private void registerConnectionManager(final WorkerFactory factory, final MaxWorkersConfig maxWorkersConfig) {
final Worker connectionUpdaterWorker =
factory.newWorker(TemporalJobType.CONNECTION_UPDATER.toString(), getWorkerOptions(maxWorkersConfig.getMaxSyncWorkers()));
final WorkflowImplementationOptions options = WorkflowImplementationOptions.newBuilder()
.setFailWorkflowExceptionTypes(NonDeterministicException.class).build();
connectionUpdaterWorker
.registerWorkflowImplementationTypes(temporalProxyHelper.proxyWorkflowClass(ConnectionManagerWorkflowImpl.class));
.registerWorkflowImplementationTypes(options, temporalProxyHelper.proxyWorkflowClass(ConnectionManagerWorkflowImpl.class));
connectionUpdaterWorker.registerActivitiesImplementations(connectionManagerActivities.orElseThrow().toArray(new Object[] {}));
log.info("Connection Manager Workflow registered.");
}
Expand Down

0 comments on commit 2345971

Please sign in to comment.