Skip to content

Commit 91e2742

Browse files
committed
Revert "fix(bff): add retry logic for configmap conflicts on catalog source update"
This reverts commit 97d2a3d33ab7495ca90ff22b60d8ad76dc2495b6.
1 parent 7727961 commit 91e2742

1 file changed

Lines changed: 1 addition & 31 deletions

File tree

packages/model-registry/upstream/bff/internal/repositories/model_catalog_settings.go

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -220,43 +220,12 @@ func (r *ModelCatalogSettingsRepository) CreateCatalogSourceConfig(
220220
return r.GetCatalogSourceConfig(ctx, client, namespace, payload.Id)
221221
}
222222

223-
const maxConflictRetries = 3
224-
225223
func (r *ModelCatalogSettingsRepository) UpdateCatalogSourceConfig(
226224
ctx context.Context,
227225
client k8s.KubernetesClientInterface,
228226
namespace string,
229227
sourceId string,
230228
payload models.CatalogSourceConfigPayload,
231-
) (*models.CatalogSourceConfig, error) {
232-
var lastErr error
233-
for attempt := 1; attempt <= maxConflictRetries; attempt++ {
234-
result, err := r.tryUpdateCatalogSourceConfig(ctx, client, namespace, sourceId, payload)
235-
if err == nil {
236-
return result, nil
237-
}
238-
if !errors.Is(err, ErrCatalogSourceConflict) {
239-
return nil, err
240-
}
241-
lastErr = err
242-
if attempt < maxConflictRetries {
243-
sessionLogger := ctx.Value(constants.TraceLoggerKey).(*slog.Logger)
244-
sessionLogger.Warn("configmap conflict detected, retrying",
245-
"sourceId", sourceId,
246-
"attempt", attempt,
247-
"maxRetries", maxConflictRetries,
248-
)
249-
}
250-
}
251-
return nil, lastErr
252-
}
253-
254-
func (r *ModelCatalogSettingsRepository) tryUpdateCatalogSourceConfig(
255-
ctx context.Context,
256-
client k8s.KubernetesClientInterface,
257-
namespace string,
258-
sourceId string,
259-
payload models.CatalogSourceConfigPayload,
260229
) (*models.CatalogSourceConfig, error) {
261230
defaultCM, userCM, err := client.GetAllCatalogSourceConfigs(ctx, namespace)
262231
if err != nil {
@@ -380,6 +349,7 @@ func (r *ModelCatalogSettingsRepository) tryUpdateCatalogSourceConfig(
380349
}
381350

382351
return r.GetCatalogSourceConfig(ctx, client, namespace, sourceId)
352+
383353
}
384354

385355
func (r *ModelCatalogSettingsRepository) DeleteCatalogSourceConfig(

0 commit comments

Comments
 (0)