Skip to content

Race condition in CSV export flow causes column mismatch when multiple exports run concurrently #24961

@harsh-vador

Description

@harsh-vador

Describe the bug
A race condition exists in the CSV export functionality when multiple export operations are triggered simultaneously. When a service export is in progress and a glossary export is triggered at the same time, the websocket response handling causes column mismatches in the generated CSV files, where columns from one entity type (e.g., glossary terms) appear in another entity type's CSV (e.g., service CSV).

Root Cause:

The export system uses a shared state to track the currently active export job. When multiple exports are triggered concurrently, the second export overwrites the tracking information of the first one. This causes the system to mix up which data belongs to which export, resulting in CSV files with incorrect column structures.

Corrupted CSV exports with mismatched columns
Data integrity issues in exported files
Unreliable export functionality when users trigger multiple exports in quick succession

To Reproduce

  • Setup:
    • Log in to OpenMetadata instance (tested on beta environment)
    • Ensure you have both a service (database/messaging/dashboard) and a glossary with data

Trigger concurrent exports:

  1. Open a service detail page (e.g., Database Service)
  2. Click export to CSV
  3. Immediately (while the first export is processing), navigate to a Glossary
  4. Click export to CSV on the glossary

Expected behavior:

  • Service CSV should contain service-related columns (service name, type, connection details, etc.)
  • Glossary CSV should contain glossary-related columns (term name, description, synonyms, etc.)

Actual behavior:

  • One or both CSV files contain mismatched columns
  • Example: Service CSV may contain glossary term columns like "synonyms", "relatedTerms"
    Or glossary CSV may contain service-specific columns

Version:

  • OS: [e.g. iOS]
  • Python version:
  • OpenMetadata version: [e.g. 0.8]
  • OpenMetadata Ingestion package version: [e.g. openmetadata-ingestion[docker]==XYZ]

Additional context
Add any other context about the problem here.

Metadata

Metadata

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