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

drive.get hangs when offline and blocks are missing #379

Open
josephmturner opened this issue Dec 6, 2024 · 4 comments
Open

drive.get hangs when offline and blocks are missing #379

josephmturner opened this issue Dec 6, 2024 · 4 comments

Comments

@josephmturner
Copy link
Contributor

I tested this by attempting to load a file over the network after disconnecting from my wifi AP.

By adding console.log statements, I found that the _open method in the BlobReadStream class, the (this._pos === this.id.byteOffset) is truthy, and then the Hyperblobs.createReadStream hangs here.

@HDegroote
Copy link
Contributor

I think this is expected behaviour, but will let @mafintosh confirm.

You are aware of the existence of the block, so you wait for it until you get it. It will resolve once you do (in your case, when coming back online and connecting to a peer who has that block available).

What would be your expected behaviour? IMO throwing an error when a block can't be immediately fetched, for example due to connectivity issues or because no peer with that block is currently online, is a bad pattern. The general pattern we use is to wait until the block is available

@josephmturner
Copy link
Contributor Author

@HDegroote Thanks for your response!

As a user, I expect the app to error quickly if I'm disconnected from all other peers and the block is not loaded locally. Somewhere in the stack, I expect a sanity check to throw a useful error like "No peers available - double check your internet connection."

What do you think? Thank you!

@mafintosh
Copy link
Contributor

sounds hard to work with. peers come and go. the above pattern would only work in a centralised system. happy to add to the roadmap to have more options (you can use the timeout btw). for now we have wait & timeout and both allow you to do moth things.

@josephmturner
Copy link
Contributor Author

josephmturner commented Dec 15, 2024 via email

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

3 participants