Skip to content

Commit

Permalink
delete EnforceMutexKeyOnCreate flag (#12070)
Browse files Browse the repository at this point in the history
  • Loading branch information
subodh1810 committed Apr 16, 2024
1 parent ef2c87b commit 24493d1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 0 additions & 2 deletions airbyte-featureflag/src/main/kotlin/FlagDefinitions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,6 @@ object UseWorkloadApiForDiscover : Temporary<Boolean>(key = "platform.use-worklo

object UseWorkloadApiForSpec : Temporary<Boolean>(key = "platform.use-workload-api-for-spec", default = false)

object EnforceMutexKeyOnCreate : Temporary<Boolean>(key = "platform.enforce-mutex-key-on-create", default = false)

object ActivateRefreshes : Temporary<Boolean>(key = "platform.activate-refreshes", default = false)

object WriteOutputCatalogToObjectStorage : Temporary<Boolean>(key = "platform.write-output-catalog-to-object-storage", default = false)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package io.airbyte.workload.handler

import io.airbyte.config.WorkloadType
import io.airbyte.featureflag.Connection
import io.airbyte.featureflag.EnforceMutexKeyOnCreate
import io.airbyte.featureflag.FeatureFlagClient
import io.airbyte.workload.api.domain.Workload
import io.airbyte.workload.api.domain.WorkloadLabel
Expand All @@ -27,7 +25,6 @@ class WorkloadHandlerImpl(
private val featureFlagClient: FeatureFlagClient,
) : WorkloadHandler {
companion object {
val UUID_ZERO: UUID = UUID.fromString("00000000-0000-0000-0000-000000000000")
val ACTIVE_STATUSES: List<WorkloadStatus> =
listOf(WorkloadStatus.PENDING, WorkloadStatus.CLAIMED, WorkloadStatus.LAUNCHED, WorkloadStatus.RUNNING)
}
Expand Down Expand Up @@ -96,7 +93,7 @@ class WorkloadHandlerImpl(

// Evaluating feature flag with UUID_ZERO because the client requires a context. This feature flag is intended to be used
// as a global kill switch for validation.
if (mutexKey != null && featureFlagClient.boolVariation(EnforceMutexKeyOnCreate, Connection(UUID_ZERO))) {
if (mutexKey != null) {
// Keep the most recent workload by creation date with mutexKey, fail the others.
workloadRepository
.searchByMutexKeyAndStatusInList(mutexKey, statuses = ACTIVE_STATUSES)
Expand Down

0 comments on commit 24493d1

Please sign in to comment.