-
Notifications
You must be signed in to change notification settings - Fork 27
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
Rethink out-of-memory handling in IStorageChannels #338
Comments
The more robust approach, when creating a new channel, would be to check whether there's memory space available for the channel before attempting to create it. I'm not sure how feasible this is, though. |
Ok I've done some local tests with a DMQ node, allocating and filling large channels.
|
Here's a rethought:
|
Of course, channel creation isn't the only way we can get into an OOM situation in a node. In the DHT, for example, every record that's added causes a memory allocation that could fail due to OOM. |
This would be a slight hassle, as the command would need to be run on every node. But as this would only ever be done in careful coordination with an app reading or writing a new channel, I think the risk is minimal. |
So what I'm proposing is a 2-step fix here:
Step 1 fixes the basic problem that this issue describes ( |
All requests (both legacy and neo) would be adapted to return the |
The only problem with this suggestion, I think, is that it removes the capability for channels to be created "programmatically" (i.e. channel names generated at runtime by an application). We've never needed this capability, but we'd be in trouble if we ever did need it, after having removed it. |
Previously, the only way to create a new channel from the outside was the `getCreate` method. As part of sociomantic-tsunami#338, we want to disallow ad hoc channel creation by request handlers. `getCreate` is to be deprecated, request handlers should be updated to use `opIn_r` to check for a channel's existence, and `create` is to be called via a unix socket command handler specifically to create new channels.
We plan to remove the capacity for the ad hoc creation of new channels in request handlers. Channels should instead be created via the newly added unix socket command. Part of sociomantic-tsunami#338.
`OutOfMemoryException` is deprecated. In D2, it is an `Error`, so should not be caught. Fixes sociomantic-tsunami#338.
Previously, the only way to create a new channel from the outside was the `getCreate` method. As part of sociomantic-tsunami#338, we want to disallow ad hoc channel creation by request handlers. `getCreate` is to be deprecated, request handlers should be updated to use `opIn_r` to check for a channel's existence, and `create` is to be called via a unix socket command handler specifically to create new channels.
We plan to remove the capacity for the ad hoc creation of new channels in request handlers. Channels should instead be created via the newly added unix socket command. Part of sociomantic-tsunami#338.
`OutOfMemoryException` is deprecated. In D2, it is an `Error`, so should not be caught. Fixes sociomantic-tsunami#338.
Another problem came up in verbal discussion: adding new nodes to a DHT becomes hassle. (You'd need to add all extant channels.) The conclusion of our discussion was to just remove the OOM exception handling and allow the node to crash in this situation. The burden of avoiding OOM is then on the node maintainers (which is the status quo anyway). |
`OutOfMemoryException` is deprecated. In D2, it is an `Error`, so should not be caught. Fixes sociomantic-tsunami#338.
`OutOfMemoryException` is deprecated. In D2, it is an `Error`, so should not be caught. Fixes #338.
IStorageChannels
currently has some kind of weird support for catching out-of-memory errors, and setting a flag to disallow creation of more channels (see here).OutOfMemoryException
is deprecated in ocean, and is an alias to anError
in D2. CatchingError
s is not recommended.We need to rethink this.
The text was updated successfully, but these errors were encountered: