Skip to content

Possible Bug in DataplaneAPI: Dangling and Duplicated Transaction Files with Concurrent Jobs (HAProxy Terraform Provider) #358

Open
@cepitacio

Description

@cepitacio

Description:
I have encountered a potential bug in the DataplaneAPI while working on an HAProxy provider. The issue arises when running concurrent jobs that interact with the API across multiple workspaces.

The problem does not occur when using a single workspace. Specifically:

  • Dangling Transactions: Some transactions remain uncommitted and incomplete.
  • Duplicate Files: The same transaction files also appear in the outdated/ directory.

This behavior suggests there might be an issue with transaction isolation or handling in high-concurrency, multi-workspace scenarios.

Steps to Reproduce:
Use my HAProxy provider available on the Terraform Registry: https://registry.terraform.io/providers/cepitacio/haproxy/latest

  • Set up the DataplaneAPI and configure multiple workspaces.
  • Run multiple concurrent terraform apply jobs using the provider to interact with the API.

Check the transaction directories:

  • Observe uncommitted transaction files in the main directory.
  • Note that duplicates of these files appear in the outdated/ directory.

Expected Behavior:

  • Transactions should either be committed or cleaned up properly.
  • No duplicate transaction files should exist, even under concurrent usage across multiple workspaces.

Actual Behavior:

  • Some transactions remain uncommitted and are left dangling.
  • Duplicate transaction files are created in the outdated/ directory.

Environment:
DataplaneAPI version: reproduced with v2.9.2 and v2.9.8
HAProxy version: 2.9.0
Terraform provider: https://registry.terraform.io/providers/cepitacio/haproxy/latest

Additional Notes:
I am relatively new to Go and Terraform provider development, so I might have missed something in my implementation. However, the issue seems to be directly related to the API's behavior under concurrent requests.
The issue does not occur when jobs are executed sequentially in a single workspace, which suggests it may be related to handling concurrent API transactions across workspaces.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions