Return-Path: X-Original-To: apmail-ignite-user-archive@minotaur.apache.org Delivered-To: apmail-ignite-user-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id C89BE181B9 for ; Mon, 18 Jan 2016 11:52:06 +0000 (UTC) Received: (qmail 80914 invoked by uid 500); 18 Jan 2016 11:52:06 -0000 Delivered-To: apmail-ignite-user-archive@ignite.apache.org Received: (qmail 80875 invoked by uid 500); 18 Jan 2016 11:52:06 -0000 Mailing-List: contact user-help@ignite.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@ignite.apache.org Delivered-To: mailing list user@ignite.apache.org Received: (qmail 80865 invoked by uid 99); 18 Jan 2016 11:52:06 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 18 Jan 2016 11:52:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 39D59C0D53 for ; Mon, 18 Jan 2016 11:52:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.98 X-Spam-Level: ** X-Spam-Status: No, score=2.98 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd4-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gridgain-com.20150623.gappssmtp.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id MLcTLiNpgzTv for ; Mon, 18 Jan 2016 11:51:58 +0000 (UTC) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 6F43F42A21 for ; Mon, 18 Jan 2016 11:51:57 +0000 (UTC) Received: by mail-lb0-f181.google.com with SMTP id cl12so127906982lbc.1 for ; Mon, 18 Jan 2016 03:51:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gridgain-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-type; bh=OodGHOploEDtuOmWpS7PGCgyhVAGQ7kNr2pizwduBPs=; b=ZvNiGiM8JojJdqdhtpKOImph7hYtwn1hMsj5Vu9+mGA0NN2JO6vhihyVGdndMeoCoZ 8HDeVXDhWMLEfSfr9mfcBq2PxWiiHqnXnWETgojqSC/Z61hJ1qz5hWFOaJvaYnnelITU vechTDMMo7wmHp2/N4FS9YxAcNv/0HXguPKLo41n2IMDr8ZwfYiE71Ik9K2C+U6JNgNz yP3cCnRl9NiremULyQJsknveBKbXE7vWjpPYXXgB0EXCqcZbAiWz1agyDmJQ5PVE/Olq c8jr3Xb4I0x9jdXsEJzr7FCblI//8k2BzIQMCjT+EaDQqGqJM4nGYWKI6O4HWrgkZ4eZ 4cSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-type; bh=OodGHOploEDtuOmWpS7PGCgyhVAGQ7kNr2pizwduBPs=; b=Xb0WQDpZhaTuoF2Vm6T+F8iYKxc+TMiK9/5zMzx3KqOEi6jjBcUgcjPZqJnrfMH8ec a0uqUp5Zyox57RHf54OMXXnaYuYMk4JEBandmSrj4g/YjwhX+ff3m+2MmNz6O51WCcUC 2qtZ0qHrj+K8FcbraDhPXyM/ul3TTuRmQFZ3sqzcOrppGSyXasbBU6u5SGKR9lhDQQjE LIWYlzjT2Nua37ZmLu5wWjRQW9wg/o0zihI2wsF0N+5X9YDzCpk/N08yhC7ym5ENQxy5 SFkuj/hMX+QLk3EV7yisJcnPMEMOl5g5RO/RVHCJscdEY1bbHNeEWO+AzKZjaPnGzIZu gIXw== X-Gm-Message-State: ALoCoQnf7xnB4O8/4Bdeyc9h5mb0fhR38hxeYyj7Lv1fQzOUmSPOVQ8vWudqyNFr5KMzjwk5PKrN65T+5tRDZ1seQnPclbJWbg== X-Received: by 10.112.118.206 with SMTP id ko14mr8588920lbb.108.1453117916367; Mon, 18 Jan 2016 03:51:56 -0800 (PST) Received: from [192.168.0.104] ([213.21.32.131]) by smtp.googlemail.com with ESMTPSA id 140sm3123139lfz.21.2016.01.18.03.51.55 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Jan 2016 03:51:55 -0800 (PST) Subject: Re: TcpDiscoverySpi.setLocalPortRange, value must be > 0 To: user@ignite.apache.org, dev@ignite.apache.org References: <1453108876139-2606.post@n6.nabble.com> From: Denis Magda Message-ID: <569CD1E7.3010904@gridgain.com> Date: Mon, 18 Jan 2016 14:52:07 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1453108876139-2606.post@n6.nabble.com> Content-Type: multipart/alternative; boundary="------------020406060307030508000108" This is a multi-part message in MIME format. --------------020406060307030508000108 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Hi, Thank for pointing out to this issue. Local port range set to 0 presently doesn't work at least for TcpCommunicationSpi and TcpDiscoverySpi. However SPIs support it. In my understanding the condition has to changed to the following one (from < to <=). x = port; x*<=* port + range But this will violate the following from TcpCommunicationSpi.setLocalPortRange implementation will try to increment the port number for as long as it is less than * initial value plus this range. So it means that setLocalPortRange has to be treated a different way and in fact setLocalPortRange=0 will be the same as setLocalPortRange=1 I've copied the message to @dev list to get more thoughts on this. Igniters, any thoughts? Should localPortRange=0 work the same as localPortRange=1? -- Denis On 1/18/2016 12:21 PM, DLopez wrote: > Hi, > > While experimenting, as I was trying to just allow specific ports, I set the > LocalPortRange of my configurations to 0. The result was not what I expected > as you end up getting a NPE when starting the cluster. I traced the issue in > the source and the cause is that when opening ports, the routine goes from > the x = port; x < port + range. So you end up with no server socket, and > when you try to listen to it, kaboum. > > So I think it might be interesting to clarify the docs, as the current > definition (starting from getLocalPort() up until getLocalPort() + > locPortRange) can be misunderstood and the handling of localport value, > throwing an error if it is set to an incorrect value. > > Just to prevent other people having the same issue :). Not a top priority, > of course, but such an easy change can prevent more support messages to the > list to... What do you think? > > S! > D. > > > > -- > View this message in context: http://apache-ignite-users.70518.x6.nabble.com/TcpDiscoverySpi-setLocalPortRange-value-must-be-0-tp2606.html > Sent from the Apache Ignite Users mailing list archive at Nabble.com. --------------020406060307030508000108 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: 8bit Hi,

Thank for pointing out to this issue. Local port range set to 0 presently doesn't work at least for TcpCommunicationSpi and TcpDiscoverySpi. However SPIs support it.

In my understanding the condition has to changed to the following one (from < to <=).
x = port; x <= port + range
But this will violate the following from TcpCommunicationSpi.setLocalPortRange
implementation will try to increment the port number for as long as it is less than
* initial value plus this range.

So it means that setLocalPortRange has to be treated a different way and in fact setLocalPortRange=0 will be the same as setLocalPortRange=1

I've copied the message to @dev list to get more thoughts on this.

Igniters, any thoughts? Should localPortRange=0 work the same as localPortRange=1?

--
Denis

On 1/18/2016 12:21 PM, DLopez wrote:
Hi,

While experimenting, as I was trying to just allow specific ports, I set the
LocalPortRange of my configurations to 0. The result was not what I expected
as you end up getting a NPE when starting the cluster. I traced the issue in
the source and the cause is that when opening ports, the routine goes from
the x = port; x < port + range. So you end up with no server socket, and
when you try to listen to it, kaboum.

So I think it might be interesting to clarify the docs, as the current
definition (starting from getLocalPort() up until getLocalPort() +
locPortRange) can be misunderstood and the handling of localport value,
throwing an error if it is set to an incorrect value.

Just to prevent other people having the same issue :). Not a top priority,
of course, but such an easy change can prevent more support messages to the
list to... What do you think?

S!
D.



--
View this message in context: http://apache-ignite-users.70518.x6.nabble.com/TcpDiscoverySpi-setLocalPortRange-value-must-be-0-tp2606.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.

--------------020406060307030508000108--