10000 dont trigger noSpaceLeft on huge shards by littleskunk · Pull Request #753 · storj-archived/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Oct 30, 2018. It is now read-only.

dont trigger noSpaceLeft on huge shards #753

Merged
merged 1 commit into from
Jan 2, 2018

Conversation

littleskunk
Copy link
Collaborator

@braydonf
Copy link
Contributor
braydonf commented Jan 2, 2018

So without this, I do not think spaceAvailable will ever be set to false, as we're not running runSpaceCheck to start the interval that will check it due to that method currently using too much CPU and memory on large databases.

We are running the connectBridges interval that will update a bridge contact info for a farmer to have spaceAvailable if the values differ (https://github.com/littleskunk/core/blob/644d4af70317eba050e55b751fff074a7866a18e/lib/network/farmer.js#L380-L385).

@littleskunk
Copy link
Collaborator Author

Can you link that interval? I haven't seen something like that. The connectBridges is called only once on startup as far as I know.

@braydonf
Copy link
Contributor
braydonf commented Jan 2, 2018

@littleskunk
Copy link
Collaborator Author
littleskunk commented Jan 2, 2018

How about this: https://github.com/Storj/core/blob/9691c6a17991a0487e1069a1000db5035b1c57ba/lib/network/farmer.js#L284-L286

As far as I can see the farmer is already connected with the bridge and will skip every additional call?

@braydonf
Copy link
Contributor
braydonf commented Jan 2, 2018

Ah yeah, that could be it.

@braydonf
Copy link
Contributor
braydonf commented Jan 2, 2018

The check for differences in contact data is after that check in _connectBridge

@braydonf
Copy link
Contributor
braydonf commented Jan 2, 2018

I probably neglected to write an integration test for all those methods being used together, and hence the oversight.

@braydonf
Copy link
Contributor
braydonf commented Jan 2, 2018

Okay, merging this and we can fix updating spaceAvailable in a new PR, and then we can make a release

@braydonf braydonf merged commit c36a174 into storj-archived:master Jan 2, 2018
@braydonf
Copy link
Contributor
braydonf commented Jan 2, 2018

Actually, @littleskunk the connected flag gets set to false when noSpaceLeft is called, which should trigger the check and update: https://github.com/Storj/core/blob/master/lib/network/farmer.js#L365

@braydonf
Copy link
Contributor
braydonf commented Jan 2, 2018

We may just need to fix runSpaceCheck and re-enable that interval.

@braydonf
Copy link
Contributor
braydonf commented Jan 3, 2018

Continuing on this with a new PR #755

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

Successfully merging this pull request may close these issues.

2 participants
0