sdk
sdk copied to clipboard
[SM-1413] Temporary PR to Showcase 'hyper' Error
đī¸ 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 thesdk/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
- For Mac arm CPU's:
- Update the following variables for your environment in the
sdk/languages/go/example/example.go
file:-
OrganizationId
-
AccessToken
-
statePath
-
- From
sdk/languages/go/example
, rungo 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