Skip to content

Conversation

@adeneche
Copy link
Contributor

…uf, this error is just logged and nothing else is done

…uf, this error is just logged and nothing else is done
outOfMemoryHandler.handle();
return;
}
ByteBuf outBuf = allocator.buffer(length);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm that this has a consistent failure behavior by adding a test and create a very small rpc allocator (maybe add a config option to set the max for allocator (not just reservation)).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look into that. So far, when I was trying to reproduce the issue through Sqlline I would get an OutOfMemory error in a different place (earlier ?) of the RPC layer.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I was looking at how we are using ProtobufLengthDecoder in our code, and we use in the control, server and user tunnels both on the client and server side.
If I am not mistaken, the only derived class from ProtobufLengthDecoder that actually uses an rpc allocator is UserProtobufLengthDecoder and only on the server side of the user tunnel. All other implementations use the root allocator.
This may actually explain why I wasn't able to reproduce this issue no matter how much I reduced the "rpc:bit-data" max allocation.

am I missing something ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jacques-n can you confirm it's indeed the case ? thanks

@adeneche
Copy link
Contributor Author

So I spent more time looking at ways to create a unit test for this, and I don't think it's possible:
First, current implementation of ProtobufLengthDecoder for the data tunnel uses the root allocator, which is weird and changing the rpc max allocation won't help in this case.
Second, even after I changed the implementation and made sure ProtobufLengthDecoder uses the rpc allocator, this same allocator is used by netty too and you can't control where it will run out of memory, in most of my experiments it run out of memory in ByteToMessageDecoder, so writing a unit test using this won't be reliable as it won't consistently reproduce the issue.

@jacques-n
Copy link
Contributor

Thanks for trying to put together a test.

Can you include the fix to correct the issue about the root allocator as well. I haven't had a chance to look at that but it would explain why those numbers have been as low as they have been.

@adeneche
Copy link
Contributor Author

Done.

@jacques-n
Copy link
Contributor

+1 on this. Can you just confirm the behavior you're expecting in the out of memory situation?

@adeneche
Copy link
Contributor Author

I was not able to reproduce an out of memory from the ProtobufLengthDecoder. But I whenever I got an out of memory from ByteToMessageDecoder the query would fail properly, thanks to the fix for DRILL-3714

@jacques-n
Copy link
Contributor

To confirm, the expectation is the exception is caught by the rpc handler and propagated back to the sender via the coordination id, right?

@adeneche
Copy link
Contributor Author

This is indeed what happens

@jacques-n
Copy link
Contributor

Great, thanks!

@jacques-n
Copy link
Contributor

Does this get propated as a connection level failure or an RpcRemoteException. (E.g. do we break connection once this happens?) Seems like it would be better to generate a RpcRemoteException on the sending side to ensure that the connection is maintained.

karthik-man pushed a commit to karthik-man/drill that referenced this pull request Mar 14, 2019
* MD-5265: Introduction of 4th digit in pom.xml files

Switching to ${revision}
https://maven.apache.org/maven-ci-friendly.html#Multi_Module_Setup

[Apache Issue] 
DRILL-6956: Maintain a single entry for Drill Version in the pom file 
Note: client/pom.xml and contrib/auth-mechanism-maprsasl/pom.xml are the only additional files in the MapR distro and not present in Apache

* Reverting to using explicit version information for all POMs until DevOps does upgrade to `Maven 3.5.0`+
@jacques-n
Copy link
Contributor

Abandoned.

@jacques-n jacques-n closed this Aug 26, 2020
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

Successfully merging this pull request may close these issues.

2 participants