Skip to content

async-destination-framework: make GlobalAsyncStateManager entirely thread safe - #35027

Merged
Subodh Chaturvedi (subodh1810) merged 8 commits into
masterfrom
make-global-async-state-manager-thread-safe
Feb 8, 2024
Merged

async-destination-framework: make GlobalAsyncStateManager entirely thread safe#35027
Subodh Chaturvedi (subodh1810) merged 8 commits into
masterfrom
make-global-async-state-manager-thread-safe

Conversation

@subodh1810

@subodh1810 Subodh Chaturvedi (subodh1810) commented Feb 8, 2024

Copy link
Copy Markdown
Contributor

See slack thread https://airbytehq-team.slack.com/archives/C0624HL9UTU/p1707392863771999?thread_ts=1707315038.780149&cid=C0624HL9UTU

The main change in the PR is to

  1. Convert the LinkedList used in the descToStateIdQ to LinkedBlockingDeque cause LinkedList is not thread safe.
  2. Add arrivalNumber for logging purposes so thats its easier to debug if the destination is emitting state messages in the same order as they arrived for GLOBAL state type
  3. Taking a more conservative approach around the thread safety of the entire class. This is because now the state message is also used for checksum validation and any variance in the behaviour can make the count vary from what platform and source see.

@vercel

vercel Bot commented Feb 8, 2024

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 8, 2024 8:51pm

@octavia-squidington-iii Octavia Squidington III (octavia-squidington-iii) added the CDK Connector Development Kit label Feb 8, 2024
@subodh1810

Copy link
Copy Markdown
Contributor Author

Snowflake tests passing with these changes
Screenshot 2024-02-08 at 11 15 16 PM

Bigquery tests passing with these changes
Screenshot 2024-02-08 at 11 15 38 PM

@edgao Edward Gao (edgao) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

couple random questions, see also dm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lookout for Ed's PR; possible merge conflict in SnowflakeDestinationHandler.

// All access to this field MUST be guarded by a synchronized(lock) block
private long arrivalNumber = 0;

private final Object lock = new Object();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: allcaps constant name

@subodh1810

Subodh Chaturvedi (subodh1810) commented Feb 8, 2024

Copy link
Copy Markdown
Contributor Author

/publish-java-cdk

🕑 https://github.com/airbytehq/airbyte/actions/runs/7835484849
✅ Successfully published Java CDK version=0.17.1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/connectors Connector related issues area/documentation Improvements or additions to documentation CDK Connector Development Kit connectors/destination/bigquery connectors/destination/snowflake

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants