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

Object store client race condition #544

Open
ianeal opened this issue Nov 21, 2024 · 4 comments
Open

Object store client race condition #544

ianeal opened this issue Nov 21, 2024 · 4 comments
Labels
SDK Issue pertains to the SDK itself and not specific to any service

Comments

@ianeal
Copy link

ianeal commented Nov 21, 2024

Object store client exhibits race condition using SDK version v65.79.0 when attempting to use multiple clients in different go routines.

e.g.
client, err := objectstorage.NewObjectStorageClientWithConfigurationProvider(provider)

WARNING: DATA RACE
Read at 0x000002d8a470 by goroutine 87:
github.com/oracle/oci-go-sdk/v65/common.CheckForEnabledServices()
github.com/oracle/oci-go-sdk/[email protected]/common/common.go:603 +0x31
github.com/oracle/oci-go-sdk/v65/objectstorage.NewObjectStorageClientWithConfigurationProvider()
github.com/oracle/oci-go-sdk/[email protected]/objectstorage/objectstorage_client.go:34 +0x65

Previous write at 0x000002d8a470 by goroutine 86:
github.com/oracle/oci-go-sdk/v65/common.CheckForEnabledServices()
github.com/oracle/oci-go-sdk/[email protected]/common/common.go:604 +0x55
github.com/oracle/oci-go-sdk/v65/objectstorage.NewObjectStorageClientWithConfigurationProvider()

@richachugh11
Copy link

Hi @ianeal ,
Is this issue consistently observed in SDK version v65.79.0? Have you tried other versions (earlier or later)? Additionally , could you let us know if there is a specific use case you were running when the issue occurred?

@richachugh11 richachugh11 added the SDK Issue pertains to the SDK itself and not specific to any service label Nov 27, 2024
@ianeal
Copy link
Author

ianeal commented Nov 27, 2024

Hi @richachugh11,

I haven't tried any older versions, but it's reproducible when I run the go code with -race flag to enable the detection of race conditions.

My specific use case is to have a go routine per compartment OCID for a given tenancy access the metrics files generated for that compartment id. I'm using the oracle connector hub which I'm using to write the metrics files to a single object bucket.

In order to produce the steps are

  1. main go routine generates a provider in my case a RawProvider
  2. have go routine 1 create a new object storage client and fetch the data for compartment 1
  3. have go another go routine 2 create a new object storage client and fetch the data for compartment 2.

It seems that an init function should be used here to initialize this variable (or a lock would work also).

@JoshuaWR
Copy link
Member

Hi @ianeal, thank you for helping to identify this race condition. I can create a ticket for it so that our team can begin to work on it. Looking at the actual race condition itself though, it seems like it should be benign in most cases. In your experience, has this race caused any issues for you?

@ianeal
Copy link
Author

ianeal commented Jan 2, 2025

@JoshuaWR I don't believe the race condition was causing any problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
SDK Issue pertains to the SDK itself and not specific to any service
Projects
None yet
Development

No branches or pull requests

3 participants