Return-Path: X-Original-To: apmail-hbase-issues-archive@www.apache.org Delivered-To: apmail-hbase-issues-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6A89618387 for ; Fri, 13 Nov 2015 05:19:11 +0000 (UTC) Received: (qmail 97034 invoked by uid 500); 13 Nov 2015 05:19:11 -0000 Delivered-To: apmail-hbase-issues-archive@hbase.apache.org Received: (qmail 96985 invoked by uid 500); 13 Nov 2015 05:19:11 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 96965 invoked by uid 99); 13 Nov 2015 05:19:11 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Nov 2015 05:19:11 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 12DB32C1F69 for ; Fri, 13 Nov 2015 05:19:11 +0000 (UTC) Date: Fri, 13 Nov 2015 05:19:11 +0000 (UTC) From: "Abhishek Kumar (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HBASE-14771) RpcServer.getRemoteAddress always returns null. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HBASE-14771?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Abhishek Kumar updated HBASE-14771: ----------------------------------- Attachment: HBASE-14771-V2.patch i was on leave for two days:), updated patch attached, thanks. > 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)