Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[service-utils] fix: crash if Kafka connects more than once #6387

Merged
merged 1 commit into from
Mar 1, 2025

Conversation

arcoraven
Copy link
Contributor

@arcoraven arcoraven commented Mar 1, 2025

PR-Codex overview

This PR introduces a mechanism in the KafkaProducer class to ensure that the connect() method is called only once using a promise. This change improves connection management by allowing concurrent calls without redundancy.

Detailed summary

  • Removed the isConnected boolean flag.
  • Added a connectPromise property to manage the connection state.
  • Modified the connect() method to cache the connection promise.
  • Updated the message sending logic to always call await this.connect().

✨ Ask PR-Codex anything about this PR by commenting with /codex {your question}

Copy link

vercel bot commented Mar 1, 2025

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

Name Status Preview Comments Updated (UTC)
docs-v2 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 1, 2025 0:10am
login ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 1, 2025 0:10am
thirdweb_playground ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 1, 2025 0:10am
thirdweb-www ❌ Failed (Inspect) Mar 1, 2025 0:10am
wallet-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 1, 2025 0:10am

@arcoraven arcoraven requested a review from a team as a code owner March 1, 2025 12:08
Copy link

changeset-bot bot commented Mar 1, 2025

🦋 Changeset detected

Latest commit: 87fda16

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@thirdweb-dev/service-utils Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link

graphite-app bot commented Mar 1, 2025

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge-queue - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

Copy link

codecov bot commented Mar 1, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.71%. Comparing base (25b149d) to head (87fda16).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6387   +/-   ##
=======================================
  Coverage   54.71%   54.71%           
=======================================
  Files         874      874           
  Lines       54617    54617           
  Branches     3717     3717           
=======================================
  Hits        29885    29885           
  Misses      24637    24637           
  Partials       95       95           
Flag Coverage Δ
packages 54.71% <ø> (ø)

Copy link
Contributor

github-actions bot commented Mar 1, 2025

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
thirdweb (esm) 46.82 KB (0%) 937 ms (0%) 120 ms (+98.5% 🔺) 1.1 s
thirdweb (cjs) 127.18 KB (0%) 2.6 s (0%) 193 ms (+18.34% 🔺) 2.8 s
thirdweb (minimal + tree-shaking) 5.6 KB (0%) 112 ms (0%) 57 ms (+800.33% 🔺) 169 ms
thirdweb/chains (tree-shaking) 506 B (0%) 10 ms (0%) 13 ms (+366.84% 🔺) 23 ms
thirdweb/react (minimal + tree-shaking) 19.38 KB (0%) 388 ms (0%) 60 ms (+324.49% 🔺) 448 ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant