sdk icon indicating copy to clipboard operation
sdk copied to clipboard

[SM-1413] Temporary PR to Showcase 'hyper' Error

Open coltonhurst opened this issue 6 months ago â€ĸ 2 comments

🎟ī¸ Tracking

https://bitwarden.atlassian.net/browse/SM-1413

📔 Objective

🚨 Do Not Merge This PR 🚨

The goal of this PR is to allow a developer to easily reproduce a potential bug with hyper that we are running into.

Description

When running concurrent requests using the same client from the Go SDK binding, execution stops for at least one of the threads at runtime with the following error: runtime dropped the dispatch task.

Replication Steps

  • cargo build from root
  • npm run schemas from root
  • Move the built sdk/target/debug/libbitwarden_c.a to the sdk/languages/go/internal/cinterface/lib/{arch} folder, where {arch} is your CPU architecture.
    • For Mac arm CPU's: darwin-arm64
    • Other examples of potential folder names can be found here
  • Update the following variables for your environment in the sdk/languages/go/example/example.go file:
    • OrganizationId
    • AccessToken
    • statePath
  • From sdk/languages/go/example, run go build
  • From sdk/languages/go/example, run ./example > go-log.txt 2>&1

Open the go-log.txt file and you should find something similar to the following (certain data redacted and replaced with x):

[2024-08-13T23:04:01Z DEBUG reqwest::connect] starting new connection: http://localhost:4000/
SecretWithProjectsListResponseModel { object: Some("SecretsWithProjectsList"), secrets: Some([SecretsWithProjectsInnerSecret { id: Some(x), organization_id: Some(x), key: Some("x"), creation_date: Some("2024-08-01T20:09:48.024313Z"), revision_date: Some("2024-08-01T20:09:48.024313Z"), projects: Some([SecretWithProjectsInnerProject { id: Some(x), name: Some("x") }]), read: Some(true), write: Some(true) }]), projects: Some([SecretWithProjectsInnerProject { id: Some(x), name: Some("x") }]) }
Reqwest(reqwest::Error { kind: Request, url: Url { scheme: "http", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("localhost")), port: Some(4000), path: "/organizations/x/projects", query: None, fragment: None }, source: hyper_util::client::legacy::Error(SendRequest, hyper::Error(User(DispatchGone), "runtime dropped the dispatch task")) })

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

đŸĻŽ Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹī¸ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠ī¸ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or â™ģī¸ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

coltonhurst avatar Aug 13 '24 23:08 coltonhurst