[jira] [Commented] (HBASE-14771) RpcServer.getRemoteAddress always returns null.
[ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15009997#comment-15009997 ] Hadoop QA commented on HBASE-14771: --- {color:green}+1 overall{color}. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12772836/14771-V2.patch against master branch at commit dadfe7da0484be81ae09ad61f976967b9893c38d. ATTACHMENT ID: 12772836 {color:green}+1 @author{color}. The patch does not contain any @author tags. {color:green}+1 tests included{color}. The patch appears to include 3 new or modified tests. {color:green}+1 hadoop versions{color}. The patch compiles with all supported hadoop versions (2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.6.0 2.6.1 2.7.0 2.7.1) {color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings. {color:green}+1 protoc{color}. The applied patch does not increase the total number of protoc compiler warnings. {color:green}+1 javadoc{color}. The javadoc tool did not generate any warning messages. {color:green}+1 checkstyle{color}. The applied patch does not increase the total number of checkstyle errors {color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version 2.0.3) warnings. {color:green}+1 release audit{color}. The applied patch does not increase the total number of release audit warnings. {color:green}+1 lineLengths{color}. The patch does not introduce lines longer than 100 {color:green}+1 site{color}. The mvn post-site goal succeeds with this patch. {color:green}+1 core tests{color}. The patch passed unit tests in . Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/16555//testReport/ Release Findbugs (version 2.0.3)warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/16555//artifact/patchprocess/newFindbugsWarnings.html Checkstyle Errors: https://builds.apache.org/job/PreCommit-HBASE-Build/16555//artifact/patchprocess/checkstyle-aggregate.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/16555//console This message is automatically generated. > RpcServer.getRemoteAddress always returns null. > --- > > Key: HBASE-14771 > URL: https://issues.apache.org/jira/browse/HBASE-14771 > Project: HBase > Issue Type: Bug > Components: IPC/RPC >Affects Versions: 1.2.0 >Reporter: Abhishek Kumar >Assignee: Abhishek Kumar >Priority: Minor > Attachments: 14771-V2.patch, HBASE-14771-V1.patch, > HBASE-14771-V2.patch, HBASE-14771.patch > > > RpcServer.getRemoteAddress always returns null, because Call object is > getting initialized with null.This seems to be happening because of using > RpcServer.getRemoteIp() in Call object constructor before RpcServer thread > local 'CurCall' being set in CallRunner.run method: > {noformat} > // --- RpcServer.java --- > protected void processRequest(byte[] buf) throws IOException, > InterruptedException { > . > // Call object getting initialized here with address > // obtained from RpcServer.getRemoteIp() > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, RpcServer.getRemoteIp()); > scheduler.dispatch(new CallRunner(RpcServer.this, call)); > } > // getRemoteIp method gets address from threadlocal 'CurCall' which > // gets set in CallRunner.run and calling it before this as in above case, > will return null > // --- CallRunner.java --- > public void run() { > . > Pair resultPair = null; > RpcServer.CurCall.set(call); > .. > } > // Using 'this.addr' in place of getRemoteIp method in RpcServer.java seems > to be fixing this issue > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, this.addr); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-14771) RpcServer.getRemoteAddress always returns null.
[ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15004673#comment-15004673 ] Hadoop QA commented on HBASE-14771: --- {color:green}+1 overall{color}. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12772116/HBASE-14771-V2.patch against master branch at commit 789f8a5a70242c16ce10bc95401c51c7d04debfa. ATTACHMENT ID: 12772116 {color:green}+1 @author{color}. The patch does not contain any @author tags. {color:green}+1 tests included{color}. The patch appears to include 3 new or modified tests. {color:green}+1 hadoop versions{color}. The patch compiles with all supported hadoop versions (2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.6.0 2.6.1 2.7.0 2.7.1) {color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings. {color:green}+1 protoc{color}. The applied patch does not increase the total number of protoc compiler warnings. {color:green}+1 javadoc{color}. The javadoc tool did not generate any warning messages. {color:green}+1 checkstyle{color}. The applied patch does not increase the total number of checkstyle errors {color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version 2.0.3) warnings. {color:green}+1 release audit{color}. The applied patch does not increase the total number of release audit warnings. {color:green}+1 lineLengths{color}. The patch does not introduce lines longer than 100 {color:green}+1 site{color}. The mvn post-site goal succeeds with this patch. {color:red}-1 core tests{color}. The patch failed these unit tests: Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/16515//testReport/ Release Findbugs (version 2.0.3)warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/16515//artifact/patchprocess/newFindbugsWarnings.html Checkstyle Errors: https://builds.apache.org/job/PreCommit-HBASE-Build/16515//artifact/patchprocess/checkstyle-aggregate.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/16515//console This message is automatically generated. > RpcServer.getRemoteAddress always returns null. > --- > > Key: HBASE-14771 > URL: https://issues.apache.org/jira/browse/HBASE-14771 > Project: HBase > Issue Type: Bug > Components: IPC/RPC >Affects Versions: 1.2.0 >Reporter: Abhishek Kumar >Assignee: Abhishek Kumar >Priority: Minor > Attachments: HBASE-14771-V1.patch, HBASE-14771-V2.patch, > HBASE-14771.patch > > > RpcServer.getRemoteAddress always returns null, because Call object is > getting initialized with null.This seems to be happening because of using > RpcServer.getRemoteIp() in Call object constructor before RpcServer thread > local 'CurCall' being set in CallRunner.run method: > {noformat} > // --- RpcServer.java --- > protected void processRequest(byte[] buf) throws IOException, > InterruptedException { > . > // Call object getting initialized here with address > // obtained from RpcServer.getRemoteIp() > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, RpcServer.getRemoteIp()); > scheduler.dispatch(new CallRunner(RpcServer.this, call)); > } > // getRemoteIp method gets address from threadlocal 'CurCall' which > // gets set in CallRunner.run and calling it before this as in above case, > will return null > // --- CallRunner.java --- > public void run() { > . > Pair resultPair = null; > RpcServer.CurCall.set(call); > .. > } > // Using 'this.addr' in place of getRemoteIp method in RpcServer.java seems > to be fixing this issue > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, this.addr); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-14771) RpcServer.getRemoteAddress always returns null.
[ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15004401#comment-15004401 ] Appy commented on HBASE-14771: -- +1 > RpcServer.getRemoteAddress always returns null. > --- > > Key: HBASE-14771 > URL: https://issues.apache.org/jira/browse/HBASE-14771 > Project: HBase > Issue Type: Bug > Components: IPC/RPC >Affects Versions: 1.2.0 >Reporter: Abhishek Kumar >Assignee: Abhishek Kumar >Priority: Minor > Attachments: HBASE-14771-V1.patch, HBASE-14771-V2.patch, > HBASE-14771.patch > > > RpcServer.getRemoteAddress always returns null, because Call object is > getting initialized with null.This seems to be happening because of using > RpcServer.getRemoteIp() in Call object constructor before RpcServer thread > local 'CurCall' being set in CallRunner.run method: > {noformat} > // --- RpcServer.java --- > protected void processRequest(byte[] buf) throws IOException, > InterruptedException { > . > // Call object getting initialized here with address > // obtained from RpcServer.getRemoteIp() > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, RpcServer.getRemoteIp()); > scheduler.dispatch(new CallRunner(RpcServer.this, call)); > } > // getRemoteIp method gets address from threadlocal 'CurCall' which > // gets set in CallRunner.run and calling it before this as in above case, > will return null > // --- CallRunner.java --- > public void run() { > . > Pair resultPair = null; > RpcServer.CurCall.set(call); > .. > } > // Using 'this.addr' in place of getRemoteIp method in RpcServer.java seems > to be fixing this issue > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, this.addr); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-14771) RpcServer.getRemoteAddress always returns null.
[ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15003108#comment-15003108 ] Appy commented on HBASE-14771: -- [~a72877] Let's drive it to the end. Only need to copy-paste the code from your last comment. > RpcServer.getRemoteAddress always returns null. > --- > > Key: HBASE-14771 > URL: https://issues.apache.org/jira/browse/HBASE-14771 > Project: HBase > Issue Type: Bug > Components: IPC/RPC >Affects Versions: 1.2.0 >Reporter: Abhishek Kumar >Assignee: Abhishek Kumar >Priority: Minor > Attachments: HBASE-14771-V1.patch, HBASE-14771.patch > > > RpcServer.getRemoteAddress always returns null, because Call object is > getting initialized with null.This seems to be happening because of using > RpcServer.getRemoteIp() in Call object constructor before RpcServer thread > local 'CurCall' being set in CallRunner.run method: > {noformat} > // --- RpcServer.java --- > protected void processRequest(byte[] buf) throws IOException, > InterruptedException { > . > // Call object getting initialized here with address > // obtained from RpcServer.getRemoteIp() > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, RpcServer.getRemoteIp()); > scheduler.dispatch(new CallRunner(RpcServer.this, call)); > } > // getRemoteIp method gets address from threadlocal 'CurCall' which > // gets set in CallRunner.run and calling it before this as in above case, > will return null > // --- CallRunner.java --- > public void run() { > . > Pair resultPair = null; > RpcServer.CurCall.set(call); > .. > } > // Using 'this.addr' in place of getRemoteIp method in RpcServer.java seems > to be fixing this issue > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, this.addr); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-14771) RpcServer.getRemoteAddress always returns null.
[ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14999218#comment-14999218 ] Appy commented on HBASE-14771: -- Perfect! > RpcServer.getRemoteAddress always returns null. > --- > > Key: HBASE-14771 > URL: https://issues.apache.org/jira/browse/HBASE-14771 > Project: HBase > Issue Type: Bug > Components: IPC/RPC >Affects Versions: 1.2.0 >Reporter: Abhishek Kumar >Assignee: Abhishek Kumar >Priority: Minor > Attachments: HBASE-14771-V1.patch, HBASE-14771.patch > > > RpcServer.getRemoteAddress always returns null, because Call object is > getting initialized with null.This seems to be happening because of using > RpcServer.getRemoteIp() in Call object constructor before RpcServer thread > local 'CurCall' being set in CallRunner.run method: > {noformat} > // --- RpcServer.java --- > protected void processRequest(byte[] buf) throws IOException, > InterruptedException { > . > // Call object getting initialized here with address > // obtained from RpcServer.getRemoteIp() > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, RpcServer.getRemoteIp()); > scheduler.dispatch(new CallRunner(RpcServer.this, call)); > } > // getRemoteIp method gets address from threadlocal 'CurCall' which > // gets set in CallRunner.run and calling it before this as in above case, > will return null > // --- CallRunner.java --- > public void run() { > . > Pair resultPair = null; > RpcServer.CurCall.set(call); > .. > } > // Using 'this.addr' in place of getRemoteIp method in RpcServer.java seems > to be fixing this issue > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, this.addr); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-14771) RpcServer.getRemoteAddress always returns null.
[ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14998683#comment-14998683 ] Abhishek Kumar commented on HBASE-14771: thanks Appy for review, i m planning to write something like below which returns remoteAddress from 'echo' method back to client, pls let me know if it seems okay for test: {noformat} // in static nested class TestRpcServer1 TestRpcServer1(RpcScheduler scheduler) throws IOException { super(null, "testRemoteAddressInCallObject", Lists .newArrayList(new BlockingServiceAndInterface(TestRpcServiceProtos.TestProtobufRpcProto .newReflectiveBlockingService(SERVICE1), null)), new InetSocketAddress("localhost", 0), CONF, scheduler); } // echo message return remoteAddress @Override public EchoResponseProto echo(RpcController unused, EchoRequestProto request) throws ServiceException { final InetAddress remoteAddr = TestRpcServer1.getRemoteAddress(); final String message = remoteAddr == null ? "NULL" : remoteAddr.getHostAddress(); return EchoResponseProto.newBuilder().setMessage(message).build(); } // in test method @Test public void testRpcServerForNotNullRemoteAddressInCallObject() throws IOException, ServiceException { final RpcScheduler scheduler = new FifoRpcScheduler(CONF, 1); final TestRpcServer1 rpcServer = new TestRpcServer1(scheduler); final InetSocketAddress localAddr = new InetSocketAddress("localhost", 0); final AbstractRpcClient client = new RpcClientImpl(CONF, HConstants.CLUSTER_ID_DEFAULT, localAddr, null); try { rpcServer.start(); final InetSocketAddress isa = rpcServer.getListenerAddress(); if (isa == null) { throw new IOException("Listener channel is closed"); } final BlockingRpcChannel channel = client.createBlockingRpcChannel( ServerName.valueOf(isa.getHostName(), isa.getPort(), System.currentTimeMillis()), User.getCurrent(), 0); TestRpcServiceProtos.TestProtobufRpcProto.BlockingInterface stub = TestRpcServiceProtos.TestProtobufRpcProto.newBlockingStub(channel); final EchoRequestProto echoRequest = EchoRequestProto.newBuilder().setMessage("GetRemoteAddress").build(); final EchoResponseProto echoResponse = stub.echo(null, echoRequest); Assert.assertEquals(localAddr.getAddress().getHostAddress(), echoResponse.getMessage()); } finally { client.close(); rpcServer.stop(); } } {noformat} > RpcServer.getRemoteAddress always returns null. > --- > > Key: HBASE-14771 > URL: https://issues.apache.org/jira/browse/HBASE-14771 > Project: HBase > Issue Type: Bug > Components: IPC/RPC >Affects Versions: 1.2.0 >Reporter: Abhishek Kumar >Assignee: Abhishek Kumar >Priority: Minor > Attachments: HBASE-14771-V1.patch, HBASE-14771.patch > > > RpcServer.getRemoteAddress always returns null, because Call object is > getting initialized with null.This seems to be happening because of using > RpcServer.getRemoteIp() in Call object constructor before RpcServer thread > local 'CurCall' being set in CallRunner.run method: > {noformat} > // --- RpcServer.java --- > protected void processRequest(byte[] buf) throws IOException, > InterruptedException { > . > // Call object getting initialized here with address > // obtained from RpcServer.getRemoteIp() > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, RpcServer.getRemoteIp()); > scheduler.dispatch(new CallRunner(RpcServer.this, call)); > } > // getRemoteIp method gets address from threadlocal 'CurCall' which > // gets set in CallRunner.run and calling it before this as in above case, > will return null > // --- CallRunner.java --- > public void run() { > . > Pair resultPair = null; > RpcServer.CurCall.set(call); > .. > } > // Using 'this.addr' in place of getRemoteIp method in RpcServer.java seems > to be fixing this issue > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, this.addr); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-14771) RpcServer.getRemoteAddress always returns null.
[ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14994418#comment-14994418 ] Appy commented on HBASE-14771: -- Thanks [~a72877] for adding the test. So we check that's it's not null, but am a bit confused here, what is the real value of address here since "AbstractRpcClient client = createRpcClient(conf);" creates client with localAddr as null. Also, tests which do not change functionality of non-test code (FifoScheduler here) are better ones. The added test is only checking that Call.remoteAddress is set correctly, but if we check that RpcServer.getRemoteAddress works correctly, it'll cover the former case and also will be a more robust test of functionality. So how about trying this..change ping method to return value of Rpc.getRemoteAddress and check it's equal to some expected address. > RpcServer.getRemoteAddress always returns null. > --- > > Key: HBASE-14771 > URL: https://issues.apache.org/jira/browse/HBASE-14771 > Project: HBase > Issue Type: Bug > Components: IPC/RPC >Affects Versions: 1.2.0 >Reporter: Abhishek Kumar >Assignee: Abhishek Kumar >Priority: Minor > Attachments: HBASE-14771-V1.patch, HBASE-14771.patch > > > RpcServer.getRemoteAddress always returns null, because Call object is > getting initialized with null.This seems to be happening because of using > RpcServer.getRemoteIp() in Call object constructor before RpcServer thread > local 'CurCall' being set in CallRunner.run method: > {noformat} > // --- RpcServer.java --- > protected void processRequest(byte[] buf) throws IOException, > InterruptedException { > . > // Call object getting initialized here with address > // obtained from RpcServer.getRemoteIp() > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, RpcServer.getRemoteIp()); > scheduler.dispatch(new CallRunner(RpcServer.this, call)); > } > // getRemoteIp method gets address from threadlocal 'CurCall' which > // gets set in CallRunner.run and calling it before this as in above case, > will return null > // --- CallRunner.java --- > public void run() { > . > Pair resultPair = null; > RpcServer.CurCall.set(call); > .. > } > // Using 'this.addr' in place of getRemoteIp method in RpcServer.java seems > to be fixing this issue > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, this.addr); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-14771) RpcServer.getRemoteAddress always returns null.
[ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14993995#comment-14993995 ] Hadoop QA commented on HBASE-14771: --- {color:green}+1 overall{color}. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12771025/HBASE-14771-V1.patch against master branch at commit bfa36891901b96b95d82f5307642c35fd2b9f534. ATTACHMENT ID: 12771025 {color:green}+1 @author{color}. The patch does not contain any @author tags. {color:green}+1 tests included{color}. The patch appears to include 3 new or modified tests. {color:green}+1 hadoop versions{color}. The patch compiles with all supported hadoop versions (2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.6.0 2.6.1 2.7.0 2.7.1) {color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings. {color:green}+1 protoc{color}. The applied patch does not increase the total number of protoc compiler warnings. {color:green}+1 javadoc{color}. The javadoc tool did not generate any warning messages. {color:green}+1 checkstyle{color}. The applied patch does not increase the total number of checkstyle errors {color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version 2.0.3) warnings. {color:green}+1 release audit{color}. The applied patch does not increase the total number of release audit warnings. {color:green}+1 lineLengths{color}. The patch does not introduce lines longer than 100 {color:green}+1 site{color}. The mvn post-site goal succeeds with this patch. {color:green}+1 core tests{color}. The patch passed unit tests in . Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/16432//testReport/ Release Findbugs (version 2.0.3)warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/16432//artifact/patchprocess/newFindbugsWarnings.html Checkstyle Errors: https://builds.apache.org/job/PreCommit-HBASE-Build/16432//artifact/patchprocess/checkstyle-aggregate.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/16432//console This message is automatically generated. > RpcServer.getRemoteAddress always returns null. > --- > > Key: HBASE-14771 > URL: https://issues.apache.org/jira/browse/HBASE-14771 > Project: HBase > Issue Type: Bug > Components: IPC/RPC >Affects Versions: 1.2.0 >Reporter: Abhishek Kumar >Assignee: Abhishek Kumar >Priority: Minor > Attachments: HBASE-14771-V1.patch, HBASE-14771.patch > > > RpcServer.getRemoteAddress always returns null, because Call object is > getting initialized with null.This seems to be happening because of using > RpcServer.getRemoteIp() in Call object constructor before RpcServer thread > local 'CurCall' being set in CallRunner.run method: > {noformat} > // --- RpcServer.java --- > protected void processRequest(byte[] buf) throws IOException, > InterruptedException { > . > // Call object getting initialized here with address > // obtained from RpcServer.getRemoteIp() > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, RpcServer.getRemoteIp()); > scheduler.dispatch(new CallRunner(RpcServer.this, call)); > } > // getRemoteIp method gets address from threadlocal 'CurCall' which > // gets set in CallRunner.run and calling it before this as in above case, > will return null > // --- CallRunner.java --- > public void run() { > . > Pair resultPair = null; > RpcServer.CurCall.set(call); > .. > } > // Using 'this.addr' in place of getRemoteIp method in RpcServer.java seems > to be fixing this issue > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, this.addr); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-14771) RpcServer.getRemoteAddress always returns null.
[ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14993334#comment-14993334 ] Appy commented on HBASE-14771: -- the patch looks good. Can you think of a unit test? Maybe using dummy service and method. > RpcServer.getRemoteAddress always returns null. > --- > > Key: HBASE-14771 > URL: https://issues.apache.org/jira/browse/HBASE-14771 > Project: HBase > Issue Type: Bug > Components: IPC/RPC >Affects Versions: 1.2.0 >Reporter: Abhishek Kumar >Assignee: Abhishek Kumar >Priority: Minor > Attachments: HBASE-14771.patch > > > RpcServer.getRemoteAddress always returns null, because Call object is > getting initialized with null.This seems to be happening because of using > RpcServer.getRemoteIp() in Call object constructor before RpcServer thread > local 'CurCall' being set in CallRunner.run method: > {noformat} > // --- RpcServer.java --- > protected void processRequest(byte[] buf) throws IOException, > InterruptedException { > . > // Call object getting initialized here with address > // obtained from RpcServer.getRemoteIp() > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, RpcServer.getRemoteIp()); > scheduler.dispatch(new CallRunner(RpcServer.this, call)); > } > // getRemoteIp method gets address from threadlocal 'CurCall' which > // gets set in CallRunner.run and calling it before this as in above case, > will return null > // --- CallRunner.java --- > public void run() { > . > Pair resultPair = null; > RpcServer.CurCall.set(call); > .. > } > // Using 'this.addr' in place of getRemoteIp method in RpcServer.java seems > to be fixing this issue > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, this.addr); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-14771) RpcServer.getRemoteAddress always returns null.
[ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14993165#comment-14993165 ] Abhishek Kumar commented on HBASE-14771: it was mainly for logging purpose such as the use of HMaster.getClientIdAuditPrefix() in create/modify etc operations and we have some custom co-processor also making use of this getRemoteAddress method which was causing some issues for us. > RpcServer.getRemoteAddress always returns null. > --- > > Key: HBASE-14771 > URL: https://issues.apache.org/jira/browse/HBASE-14771 > Project: HBase > Issue Type: Bug > Components: IPC/RPC >Affects Versions: 1.2.0 >Reporter: Abhishek Kumar >Assignee: Abhishek Kumar >Priority: Minor > Attachments: HBASE-14771.patch > > > RpcServer.getRemoteAddress always returns null, because Call object is > getting initialized with null.This seems to be happening because of using > RpcServer.getRemoteIp() in Call object constructor before RpcServer thread > local 'CurCall' being set in CallRunner.run method: > {noformat} > // --- RpcServer.java --- > protected void processRequest(byte[] buf) throws IOException, > InterruptedException { > . > // Call object getting initialized here with address > // obtained from RpcServer.getRemoteIp() > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, RpcServer.getRemoteIp()); > scheduler.dispatch(new CallRunner(RpcServer.this, call)); > } > // getRemoteIp method gets address from threadlocal 'CurCall' which > // gets set in CallRunner.run and calling it before this as in above case, > will return null > // --- CallRunner.java --- > public void run() { > . > Pair resultPair = null; > RpcServer.CurCall.set(call); > .. > } > // Using 'this.addr' in place of getRemoteIp method in RpcServer.java seems > to be fixing this issue > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, this.addr); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-14771) RpcServer.getRemoteAddress always returns null.
[ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14992714#comment-14992714 ] Appy commented on HBASE-14771: -- getRemoteAddress() always returns null because CurCall is thread local variable and is only set in threads responsible for executing CallRunners (executor in FifoRpcScheduler and those being created in RpcExecutor.startHandlers). RpcServer.getRemoteIp also uses CurCall, so it'll always return null here. Using {code}this.addr{code} makes sense. It'll definitely fix 2 of the 3 uses of getRemoteAddress(). I am not sure about the use in AccessController since I don't know it's internals. [~a72877] what do you mean by "... fixing this issue"? Where are you seeing the null values which change to legitimate address after this change? > RpcServer.getRemoteAddress always returns null. > --- > > Key: HBASE-14771 > URL: https://issues.apache.org/jira/browse/HBASE-14771 > Project: HBase > Issue Type: Bug > Components: IPC/RPC >Affects Versions: 1.2.0 >Reporter: Abhishek Kumar >Assignee: Abhishek Kumar >Priority: Minor > Attachments: HBASE-14771.patch > > > RpcServer.getRemoteAddress always returns null, because Call object is > getting initialized with null.This seems to be happening because of using > RpcServer.getRemoteIp() in Call object constructor before RpcServer thread > local 'CurCall' being set in CallRunner.run method: > {noformat} > // --- RpcServer.java --- > protected void processRequest(byte[] buf) throws IOException, > InterruptedException { > . > // Call object getting initialized here with address > // obtained from RpcServer.getRemoteIp() > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, RpcServer.getRemoteIp()); > scheduler.dispatch(new CallRunner(RpcServer.this, call)); > } > // getRemoteIp method gets address from threadlocal 'CurCall' which > // gets set in CallRunner.run and calling it before this as in above case, > will return null > // --- CallRunner.java --- > public void run() { > . > Pair resultPair = null; > RpcServer.CurCall.set(call); > .. > } > // Using 'this.addr' in place of getRemoteIp method in RpcServer.java seems > to be fixing this issue > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, this.addr); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-14771) RpcServer.getRemoteAddress always returns null.
[ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14992161#comment-14992161 ] stack commented on HBASE-14771: --- Good one. Hmmm. This used to work. Stuff got moved around? Do you know [~appy] ? Can you see? Is this the only place a Call is made? There are a few others if only on error. We should set address there too? Nice one. > RpcServer.getRemoteAddress always returns null. > --- > > Key: HBASE-14771 > URL: https://issues.apache.org/jira/browse/HBASE-14771 > Project: HBase > Issue Type: Bug > Components: IPC/RPC >Affects Versions: 1.2.0 >Reporter: Abhishek Kumar >Assignee: Abhishek Kumar >Priority: Minor > Attachments: HBASE-14771.patch > > > RpcServer.getRemoteAddress always returns null, because Call object is > getting initialized with null.This seems to be happening because of using > RpcServer.getRemoteIp() in Call object constructor before RpcServer thread > local 'CurCall' being set in CallRunner.run method: > {noformat} > // --- RpcServer.java --- > protected void processRequest(byte[] buf) throws IOException, > InterruptedException { > . > // Call object getting initialized here with address > // obtained from RpcServer.getRemoteIp() > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, RpcServer.getRemoteIp()); > scheduler.dispatch(new CallRunner(RpcServer.this, call)); > } > // getRemoteIp method gets address from threadlocal 'CurCall' which > // gets set in CallRunner.run and calling it before this as in above case, > will return null > // --- CallRunner.java --- > public void run() { > . > Pair resultPair = null; > RpcServer.CurCall.set(call); > .. > } > // Using 'this.addr' in place of getRemoteIp method in RpcServer.java seems > to be fixing this issue > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, this.addr); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)
[jira] [Commented] (HBASE-14771) RpcServer.getRemoteAddress always returns null.
[ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14992032#comment-14992032 ] Hadoop QA commented on HBASE-14771: --- {color:red}-1 overall{color}. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12770801/HBASE-14771.patch against master branch at commit 050ebe850b32057860fb94b46f955352db139db1. ATTACHMENT ID: 12770801 {color:green}+1 @author{color}. The patch does not contain any @author tags. {color:red}-1 tests included{color}. The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. {color:green}+1 hadoop versions{color}. The patch compiles with all supported hadoop versions (2.4.0 2.4.1 2.5.0 2.5.1 2.5.2 2.6.0 2.6.1 2.7.0 2.7.1) {color:green}+1 javac{color}. The applied patch does not increase the total number of javac compiler warnings. {color:green}+1 protoc{color}. The applied patch does not increase the total number of protoc compiler warnings. {color:green}+1 javadoc{color}. The javadoc tool did not generate any warning messages. {color:green}+1 checkstyle{color}. The applied patch does not increase the total number of checkstyle errors {color:green}+1 findbugs{color}. The patch does not introduce any new Findbugs (version 2.0.3) warnings. {color:green}+1 release audit{color}. The applied patch does not increase the total number of release audit warnings. {color:green}+1 lineLengths{color}. The patch does not introduce lines longer than 100 {color:green}+1 site{color}. The mvn post-site goal succeeds with this patch. {color:green}+1 core tests{color}. The patch passed unit tests in . Test results: https://builds.apache.org/job/PreCommit-HBASE-Build/16409//testReport/ Release Findbugs (version 2.0.3)warnings: https://builds.apache.org/job/PreCommit-HBASE-Build/16409//artifact/patchprocess/newFindbugsWarnings.html Checkstyle Errors: https://builds.apache.org/job/PreCommit-HBASE-Build/16409//artifact/patchprocess/checkstyle-aggregate.html Console output: https://builds.apache.org/job/PreCommit-HBASE-Build/16409//console This message is automatically generated. > RpcServer.getRemoteAddress always returns null. > --- > > Key: HBASE-14771 > URL: https://issues.apache.org/jira/browse/HBASE-14771 > Project: HBase > Issue Type: Bug > Components: IPC/RPC >Affects Versions: 1.2.0 >Reporter: Abhishek Kumar >Assignee: Abhishek Kumar >Priority: Minor > Attachments: HBASE-14771.patch > > > RpcServer.getRemoteAddress always returns null, because Call object is > getting initialized with null.This seems to be happening because of using > RpcServer.getRemoteIp() in Call object constructor before RpcServer thread > local 'CurCall' being set in CallRunner.run method: > {noformat} > // --- RpcServer.java --- > protected void processRequest(byte[] buf) throws IOException, > InterruptedException { > . > // Call object getting initialized here with address > // obtained from RpcServer.getRemoteIp() > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, RpcServer.getRemoteIp()); > scheduler.dispatch(new CallRunner(RpcServer.this, call)); > } > // getRemoteIp method gets address from threadlocal 'CurCall' which > // gets set in CallRunner.run and calling it before this as in above case, > will return null > // --- CallRunner.java --- > public void run() { > . > Pair resultPair = null; > RpcServer.CurCall.set(call); > .. > } > // Using 'this.addr' in place of getRemoteIp method in RpcServer.java seems > to be fixing this issue > Call call = new Call(id, this.service, md, header, param, cellScanner, this, > responder, > totalRequestSize, traceInfo, this.addr); > {noformat} -- This message was sent by Atlassian JIRA (v6.3.4#6332)