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

use of closed network connection #37

Open
jkowalski opened this issue Aug 18, 2020 · 3 comments
Open

use of closed network connection #37

jkowalski opened this issue Aug 18, 2020 · 3 comments

Comments

@jkowalski
Copy link

Thanks for the provider. We're using it in https://github.com/kopia/kopia

I got a bug report from one of the users kopia/kopia#547 reporting the provider sometimes returns errors like:

Post "https://pod-000-1042-01.backblaze.com/b2api/v1/b2_upload_file/a80b691f7eeff328733e0e15/c001_v0001042_t0059": write tcp 10.1.2.xxx:36218->206.190.208.112:443: use of closed network connection

The calling code is in:
https://github.com/kopia/kopia/blob/48f253173b7a0aa0a24ac30cdca755f730ea2ea5/repo/blob/b2/b2_storage.go#L180

I presume a single client is safe to be used concurrently by multiple goroutines. If that's indeed the case what could be the reason for the error?

@kothar
Copy link
Owner

kothar commented Aug 19, 2020

Thanks for the bug report. Yes, the client should be concurrency safe - there are a couple of places where coordination is needed (credential refresh for example) and are guarded by mutexes.

I'll have a look at how this might be triggered and let you know what I find.

@jkowalski
Copy link
Author

any updates here?

@kothar
Copy link
Owner

kothar commented Oct 28, 2020

Sorry, nothing that I've been able to spot. There is a potential problem with rereading a buffer in the event of a retried upload request, but each upload should always use a new connection, so I'm not sure where the use of closed network connection message could come from. Maybe related to the discussion here: golang/go#21760

I'll try to find time to write some better tests around the uploads to try to reproduce the issue, any contribution in that area would be most welcome :)

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

No branches or pull requests

2 participants