eolivelli commented on a change in pull request #297: Issue 296: Bookie
supports ephemeral port
URL: https://github.com/apache/bookkeeper/pull/297#discussion_r129768718
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/proto/BookieNettyServer.java
##########
@@ -219,7 +225,12 @@ protected void initChannel(SocketChannel ch) throws
Exception {
});
// Bind and start to accept incoming connections
- bootstrap.bind(address.getAddress(), address.getPort()).sync();
+ Channel listen = bootstrap.bind(address.getAddress(),
address.getPort()).sync().channel();
+ if (listen.localAddress() instanceof InetSocketAddress) {
+ if (conf.getBookiePort() == 0) {
+ conf.setBookiePort(((InetSocketAddress)
listen.localAddress()).getPort());
Review comment:
OK for me
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services