From rvirding@REDACTED Mon Jun 1 09:07:52 2015 From: rvirding@REDACTED (Robert Virding) Date: Mon, 1 Jun 2015 03:07:52 -0400 Subject: [erlang-questions] Erlounge in Boston next week In-Reply-To: References: Message-ID: Sorry, I miss read it. How about Tuesday, would this be better? Robert On 30 May 2015 at 11:15, Robert Virding wrote: > This sounds great, how about Wednesday or Thursday, or another day. Tee > and I are staying downtown in Friend St. > > Robert > > > On 28 May 2015 at 17:42, Steve Vinoski wrote: > >> >> On Thu, May 28, 2015 at 11:34 AM, Christopher Meiklejohn < >> cmeiklejohn@REDACTED> wrote: >> >>> On Thu, May 28, 2015 at 6:21 AM, Robert Virding >>> wrote: >>> > I will be in Boston next week together with Tee Teoh to hold a course. >>> Any >>> > local erlangers or functional programmers interested in an erlounge? >>> We will >>> > be there 31/5-5/6. >>> >>> Depending on the date chosen, I may be able to attend. >>> >>> I'm not in Boston proper, but I'm close enough to commute by train. >> >> >> Same here -- if it's Monday or Tuesday, I can probably make it, otherwise >> I can't. >> >> --steve >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hukl@REDACTED Mon Jun 1 11:16:27 2015 From: hukl@REDACTED (John-Paul Bader) Date: Mon, 01 Jun 2015 11:16:27 +0200 Subject: [erlang-questions] Implemented Poisson and Exponential Distribution In-Reply-To: <43F3CF0B-2EAB-4FBE-ABE6-8E036EA43A90@duomark.com> References: <43F3CF0B-2EAB-4FBE-ABE6-8E036EA43A90@duomark.com> Message-ID: <556C22EB.9060103@berlin.ccc.de> Hey Jay, thank your for the response. I know that append and nth are not optimal however I could not avoid it all the time and the lists at hand are rather short. I've profiled the code and it seems fairly efficient. I've taken a screenshot of the qcachegrind profile: http://smyck.org/images/rstats_profile.png ~ John Jay Nelson wrote: > Your slowest things are going to be lists:append and lists:nth. > You should use lists:sublist instead of a filter with lists:nth. > And see if there is any way to avoid appending to the end of > a list, or walking to a specific position in the other cases. > > jay > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From ino.murko@REDACTED Mon Jun 1 10:41:02 2015 From: ino.murko@REDACTED (ino murko) Date: Mon, 1 Jun 2015 10:41:02 +0200 Subject: [erlang-questions] escript capture special keys Message-ID: Hi, is there a way to capture specific keys from escript executable? Background info: I'm trying to implement command history with up and down arrows. -- Ino Murko -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Mon Jun 1 13:23:51 2015 From: vinoski@REDACTED (Steve Vinoski) Date: Mon, 1 Jun 2015 07:23:51 -0400 Subject: [erlang-questions] Erlounge in Boston next week In-Reply-To: References: Message-ID: Yes, I think Tuesday could work. Where and what time? --steve On Mon, Jun 1, 2015 at 3:07 AM, Robert Virding wrote: > Sorry, I miss read it. How about Tuesday, would this be better? > > Robert > > > On 30 May 2015 at 11:15, Robert Virding wrote: > >> This sounds great, how about Wednesday or Thursday, or another day. Tee >> and I are staying downtown in Friend St. >> >> Robert >> >> >> On 28 May 2015 at 17:42, Steve Vinoski wrote: >> >>> >>> On Thu, May 28, 2015 at 11:34 AM, Christopher Meiklejohn < >>> cmeiklejohn@REDACTED> wrote: >>> >>>> On Thu, May 28, 2015 at 6:21 AM, Robert Virding >>>> wrote: >>>> > I will be in Boston next week together with Tee Teoh to hold a >>>> course. Any >>>> > local erlangers or functional programmers interested in an erlounge? >>>> We will >>>> > be there 31/5-5/6. >>>> >>>> Depending on the date chosen, I may be able to attend. >>>> >>>> I'm not in Boston proper, but I'm close enough to commute by train. >>> >>> >>> Same here -- if it's Monday or Tuesday, I can probably make it, >>> otherwise I can't. >>> >>> --steve >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Mon Jun 1 15:16:50 2015 From: mononcqc@REDACTED (Fred Hebert) Date: Mon, 1 Jun 2015 09:16:50 -0400 Subject: [erlang-questions] escript capture special keys In-Reply-To: References: Message-ID: <20150601131649.GD95845@ferdair.local> On 06/01, ino murko wrote: >Hi, > >is there a way to capture specific keys from escript executable? > >Background info: I'm trying to implement command history with up and down >arrows. > My understanding is that escripts use an older driver/tty than the Erlang shell usually does and there's no way around that. This causes some problem when wanting to say, capture passwords and hiding the characters (see https://github.com/tsloughter/rebar3_hex/blob/64c49f62958514cf7d64cbafb190b55b1c136758/src/rebar3_hex_user.erl#L122-L131 for a workaround) However, for shell history and line numbers from an escript, there's a "fun" hacky way to do it in which you can reuse the Erlang shell architecture and boot your own there, and/or by stealing the stdio file descriptors. Rebar3 does specifically that when setting up `rebar3 shell` so it provides command stack and search regular Erlang supports: https://github.com/rebar/rebar3/blob/master/src/rebar_prv_shell.erl#L97-L119 It's all very hackish, but appears to work pretty damn well still. The hack shows itself whenever you close the shell with ^C, which skips over the whole: BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution Menu and just exits right away. After that, output gets kind of mangled on the bash/zsh shell (something looks weird with regards to what the window size is), and I have never managed to find a workaround for that. ^G q and q() or init:stop() do not have that problem. Regards, Fred. From dgud@REDACTED Mon Jun 1 15:39:18 2015 From: dgud@REDACTED (Dan Gudmundsson) Date: Mon, 01 Jun 2015 13:39:18 +0000 Subject: [erlang-questions] Observer Crashdump Viewer bug? In-Reply-To: References: Message-ID: Works for me but I have a couple of wx fixes and some updates in crashdump viewer on my branches. /Dan On Fri, May 29, 2015 at 5:34 PM Tuncer Ayaz wrote: > On Sun, May 10, 2015 at 12:00 PM, Tuncer Ayaz > wrote: > > On Fri, Apr 24, 2015 at 10:35 PM, Tuncer Ayaz wrote: > >> Can anyone else reproduce a responsive but blocked Observer > >> gui following these steps? > >> > >> # install otp 18.0 from master > >> > >> # clone and build erlguten > >> $ git clone https://github.com/richcarl/erlguten > >> $ cd erlguten > >> $ make > >> $ ./erlguten test/test1.xml > >> > >> # start Observer use File->Examine Crash Dump to load the > >> # erlguten crash dump > >> $ erl > >> 1> observer:start(). > >> ok > >> WARNING: Found unexpected tag:scheduler > >> WARNING: Found unexpected tag:scheduler > >> WARNING: Found unexpected line in general information: > >> Calling Thread > >> WARNING: Found unexpected line in ETS info: > >> Chain Length Avg > >> > >> # now it stalls in the GUI at "Processing ets" > >> > >> This does not happen if you instead start crashdump_viewer:start/0. > > > > So, can nobody else reproduce this? > > Bump? > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Mon Jun 1 16:13:53 2015 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Mon, 1 Jun 2015 16:13:53 +0200 Subject: [erlang-questions] Observer Crashdump Viewer bug? In-Reply-To: References: Message-ID: On Mon, Jun 1, 2015 at 3:39 PM, Dan Gudmundsson wrote: > Works for me but I have a couple of wx fixes and some updates in > crashdump viewer on my branches. Sounds good. Let me know which commit(s) or branch and I'll check. From lloyd@REDACTED Mon Jun 1 18:55:00 2015 From: lloyd@REDACTED (lloyd@REDACTED) Date: Mon, 1 Jun 2015 12:55:00 -0400 (EDT) Subject: [erlang-questions] Erlounge in Boston next week In-Reply-To: References: Message-ID: <1433177700.426432534@apps.rackspace.com> Hi all, I would like to join in as well. Tuesday evenining (Tomorrow, June 2?) works fine at this end. Robert, did you get my invitation re: lunch/dinner? All the best, Lloyd -----Original Message----- From: "Steve Vinoski" Sent: Monday, June 1, 2015 7:23am To: "Robert Virding" Cc: "erlang-questions" Subject: Re: [erlang-questions] Erlounge in Boston next week _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions Yes, I think Tuesday could work. Where and what time? --steve On Mon, Jun 1, 2015 at 3:07 AM, Robert Virding wrote: > Sorry, I miss read it. How about Tuesday, would this be better? > > Robert > > > On 30 May 2015 at 11:15, Robert Virding wrote: > >> This sounds great, how about Wednesday or Thursday, or another day. Tee >> and I are staying downtown in Friend St. >> >> Robert >> >> >> On 28 May 2015 at 17:42, Steve Vinoski wrote: >> >>> >>> On Thu, May 28, 2015 at 11:34 AM, Christopher Meiklejohn < >>> cmeiklejohn@REDACTED> wrote: >>> >>>> On Thu, May 28, 2015 at 6:21 AM, Robert Virding >>>> wrote: >>>> > I will be in Boston next week together with Tee Teoh to hold a >>>> course. Any >>>> > local erlangers or functional programmers interested in an erlounge? >>>> We will >>>> > be there 31/5-5/6. >>>> >>>> Depending on the date chosen, I may be able to attend. >>>> >>>> I'm not in Boston proper, but I'm close enough to commute by train. >>> >>> >>> Same here -- if it's Monday or Tuesday, I can probably make it, >>> otherwise I can't. >>> >>> --steve >>> >> >> > From rvirding@REDACTED Mon Jun 1 19:51:08 2015 From: rvirding@REDACTED (Robert Virding) Date: Mon, 1 Jun 2015 13:51:08 -0400 Subject: [erlang-questions] Erlounge in Boston next week In-Reply-To: <1433177700.426432534@apps.rackspace.com> References: <1433177700.426432534@apps.rackspace.com> Message-ID: You guys suggest a place, I know nothing. Hi Lloyd, yes i got your message but lunch is out seeing I have training all day. Robert On 1 June 2015 at 12:55, wrote: > Hi all, > > I would like to join in as well. Tuesday evenining (Tomorrow, June 2?) > works fine at this end. > > Robert, did you get my invitation re: lunch/dinner? > > All the best, > > Lloyd > > -----Original Message----- > From: "Steve Vinoski" > Sent: Monday, June 1, 2015 7:23am > To: "Robert Virding" > Cc: "erlang-questions" > Subject: Re: [erlang-questions] Erlounge in Boston next week > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > Yes, I think Tuesday could work. Where and what time? > > --steve > > On Mon, Jun 1, 2015 at 3:07 AM, Robert Virding wrote: > > > Sorry, I miss read it. How about Tuesday, would this be better? > > > > Robert > > > > > > On 30 May 2015 at 11:15, Robert Virding wrote: > > > >> This sounds great, how about Wednesday or Thursday, or another day. Tee > >> and I are staying downtown in Friend St. > >> > >> Robert > >> > >> > >> On 28 May 2015 at 17:42, Steve Vinoski wrote: > >> > >>> > >>> On Thu, May 28, 2015 at 11:34 AM, Christopher Meiklejohn < > >>> cmeiklejohn@REDACTED> wrote: > >>> > >>>> On Thu, May 28, 2015 at 6:21 AM, Robert Virding > >>>> wrote: > >>>> > I will be in Boston next week together with Tee Teoh to hold a > >>>> course. Any > >>>> > local erlangers or functional programmers interested in an erlounge? > >>>> We will > >>>> > be there 31/5-5/6. > >>>> > >>>> Depending on the date chosen, I may be able to attend. > >>>> > >>>> I'm not in Boston proper, but I'm close enough to commute by train. > >>> > >>> > >>> Same here -- if it's Monday or Tuesday, I can probably make it, > >>> otherwise I can't. > >>> > >>> --steve > >>> > >> > >> > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lloyd@REDACTED Mon Jun 1 21:05:06 2015 From: lloyd@REDACTED (lloyd@REDACTED) Date: Mon, 1 Jun 2015 15:05:06 -0400 (EDT) Subject: [erlang-questions] Erlounge in Boston next week In-Reply-To: References: <1433177700.426432534@apps.rackspace.com> Message-ID: <1433185506.400916336@apps.rackspace.com> Hi Robert, Let me know where you are staying and I'll see if I can come up with a place. May depend a bit on how many folks attending the Erlounge. Best wishes, Lloyd -----Original Message----- From: "Robert Virding" Sent: Monday, June 1, 2015 1:51pm To: lloyd@REDACTED Cc: "Steve Vinoski" , "erlang-questions" Subject: Re: [erlang-questions] Erlounge in Boston next week You guys suggest a place, I know nothing. Hi Lloyd, yes i got your message but lunch is out seeing I have training all day. Robert On 1 June 2015 at 12:55, wrote: > Hi all, > > I would like to join in as well. Tuesday evenining (Tomorrow, June 2?) > works fine at this end. > > Robert, did you get my invitation re: lunch/dinner? > > All the best, > > Lloyd > > -----Original Message----- > From: "Steve Vinoski" > Sent: Monday, June 1, 2015 7:23am > To: "Robert Virding" > Cc: "erlang-questions" > Subject: Re: [erlang-questions] Erlounge in Boston next week > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > Yes, I think Tuesday could work. Where and what time? > > --steve > > On Mon, Jun 1, 2015 at 3:07 AM, Robert Virding wrote: > > > Sorry, I miss read it. How about Tuesday, would this be better? > > > > Robert > > > > > > On 30 May 2015 at 11:15, Robert Virding wrote: > > > >> This sounds great, how about Wednesday or Thursday, or another day. Tee > >> and I are staying downtown in Friend St. > >> > >> Robert > >> > >> > >> On 28 May 2015 at 17:42, Steve Vinoski wrote: > >> > >>> > >>> On Thu, May 28, 2015 at 11:34 AM, Christopher Meiklejohn < > >>> cmeiklejohn@REDACTED> wrote: > >>> > >>>> On Thu, May 28, 2015 at 6:21 AM, Robert Virding > >>>> wrote: > >>>> > I will be in Boston next week together with Tee Teoh to hold a > >>>> course. Any > >>>> > local erlangers or functional programmers interested in an erlounge? > >>>> We will > >>>> > be there 31/5-5/6. > >>>> > >>>> Depending on the date chosen, I may be able to attend. > >>>> > >>>> I'm not in Boston proper, but I'm close enough to commute by train. > >>> > >>> > >>> Same here -- if it's Monday or Tuesday, I can probably make it, > >>> otherwise I can't. > >>> > >>> --steve > >>> > >> > >> > > > > > From mrallen1@REDACTED Mon Jun 1 21:10:25 2015 From: mrallen1@REDACTED (Mark Allen) Date: Mon, 1 Jun 2015 19:10:25 +0000 (UTC) Subject: [erlang-questions] Lager 3.0 coming soon Message-ID: <247480621.3391781.1433185825708.JavaMail.yahoo@mail.yahoo.com> Basho has been working on an update[1] to lager to support multiple event sinks so different behaviors can be configured based on type of message. Security audit information, for example, may have different needs than general event messages. Because this introduces some subtle backwards compatibility issues with lager's tracing mechanism, we're going to roll this into a new major version of lager, 3.0, along with several community PRs[2]. Specifically, the backwards compatibility problems with tracing: * Traces are sink-specific and thus will not be able to see messages destined for other sinks * Tracing to a log file that is already open for lager will only work if targeting the same sink; otherwise an error will be returned to the trace request If you're curious about the performance impact of these changes, we have been benchmarking our work. The results look good.[3] We are also opening a maintenance 2.x branch with updates (and a few bug fixes) for the current 2.1.1 release which includes support and test suite fixes for OTP 17 but without any of the new 3.0 semantics/behavior.[4] If you'd like to kick the tires, we have tagged a 3.0.0 release candidate[5], which should make it easy for you to take it for a spin. Please feel free to contact us with thoughts on lager 3.0, either via GitHub issues/comments on PRs or by replying to this thread. Thanks! [1]: https://github.com/basho/lager/pull/264 [2]: https://github.com/basho/lager/pull/270 [3]: https://gist.github.com/mrallen1/681b2b0f0e55e56e8e29 [4]: https://github.com/basho/lager/pull/269 [5]: https://github.com/basho/lager/releases/tag/3.0.0-RC1 From cmeiklejohn@REDACTED Mon Jun 1 21:12:53 2015 From: cmeiklejohn@REDACTED (Christopher Meiklejohn) Date: Mon, 1 Jun 2015 15:12:53 -0400 Subject: [erlang-questions] Erlounge in Boston next week In-Reply-To: <1433185506.400916336@apps.rackspace.com> References: <1433177700.426432534@apps.rackspace.com> <1433185506.400916336@apps.rackspace.com> Message-ID: <41E75C71-65D1-4AA5-8D16-05FDE8FE013C@basho.com> > On Jun 1, 2015, at 3:05 PM, lloyd@REDACTED wrote: > > Hi Robert, > > Let me know where you are staying and I'll see if I can come up with a place. May depend a bit on how many folks attending the Erlounge. Zeeshan Lakhani and I will be in Boston tomorrow, so we?d like to join in. Maybe we try for Meadhall in Kendall Square? - Chris Christopher Meiklejohn Senior Software Engineer Basho Technologies, Inc. cmeiklejohn@REDACTED From rvirding@REDACTED Mon Jun 1 21:25:55 2015 From: rvirding@REDACTED (Robert Virding) Date: Mon, 1 Jun 2015 15:25:55 -0400 Subject: [erlang-questions] Erlounge in Boston next week In-Reply-To: <41E75C71-65D1-4AA5-8D16-05FDE8FE013C@basho.com> References: <1433177700.426432534@apps.rackspace.com> <1433185506.400916336@apps.rackspace.com> <41E75C71-65D1-4AA5-8D16-05FDE8FE013C@basho.com> Message-ID: We are staying at the Holiday Inn on 280 Friend St. Our knowledge of Boston is limited. Robert On 1 June 2015 at 15:12, Christopher Meiklejohn wrote: > > > On Jun 1, 2015, at 3:05 PM, lloyd@REDACTED wrote: > > > > Hi Robert, > > > > Let me know where you are staying and I'll see if I can come up with a > place. May depend a bit on how many folks attending the Erlounge. > > Zeeshan Lakhani and I will be in Boston tomorrow, so we?d like to join in. > > Maybe we try for Meadhall in Kendall Square? > > - Chris > > Christopher Meiklejohn > Senior Software Engineer > Basho Technologies, Inc. > cmeiklejohn@REDACTED > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Mon Jun 1 21:52:07 2015 From: vinoski@REDACTED (Steve Vinoski) Date: Mon, 1 Jun 2015 15:52:07 -0400 Subject: [erlang-questions] Erlounge in Boston next week In-Reply-To: <41E75C71-65D1-4AA5-8D16-05FDE8FE013C@basho.com> References: <1433177700.426432534@apps.rackspace.com> <1433185506.400916336@apps.rackspace.com> <41E75C71-65D1-4AA5-8D16-05FDE8FE013C@basho.com> Message-ID: +1, Meadhall sounds like a good plan. On Mon, Jun 1, 2015 at 3:12 PM, Christopher Meiklejohn < cmeiklejohn@REDACTED> wrote: > > > On Jun 1, 2015, at 3:05 PM, lloyd@REDACTED wrote: > > > > Hi Robert, > > > > Let me know where you are staying and I'll see if I can come up with a > place. May depend a bit on how many folks attending the Erlounge. > > Zeeshan Lakhani and I will be in Boston tomorrow, so we?d like to join in. > > Maybe we try for Meadhall in Kendall Square? > > - Chris > > Christopher Meiklejohn > Senior Software Engineer > Basho Technologies, Inc. > cmeiklejohn@REDACTED > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Mon Jun 1 21:53:09 2015 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Mon, 1 Jun 2015 21:53:09 +0200 Subject: [erlang-questions] Observer Crashdump Viewer bug? In-Reply-To: References: Message-ID: On Mon, Jun 1, 2015 at 4:13 PM, Tuncer Ayaz wrote: > On Mon, Jun 1, 2015 at 3:39 PM, Dan Gudmundsson wrote: > > Works for me but I have a couple of wx fixes and some updates in > > crashdump viewer on my branches. > > Sounds good. Let me know which commit(s) or branch and I'll check. Seems fixed in git rev 2350129. I still see warning messages, but the GUI doesn't stall anymore. This is without your extra branches and just plain current master. Thanks for the fixes, which happen to resolve this as well. WARNING: Found unexpected tag:scheduler WARNING: Found unexpected tag:scheduler WARNING: Found unexpected line in general information: Calling Thread WARNING: Found unexpected line in ETS info: Chain Length Avg [last two lines repeated 20 times] From lloyd@REDACTED Mon Jun 1 21:58:01 2015 From: lloyd@REDACTED (lloyd@REDACTED) Date: Mon, 1 Jun 2015 15:58:01 -0400 (EDT) Subject: [erlang-questions] Erlounge in Boston next week In-Reply-To: References: <1433177700.426432534@apps.rackspace.com> <1433185506.400916336@apps.rackspace.com> <41E75C71-65D1-4AA5-8D16-05FDE8FE013C@basho.com> Message-ID: <1433188681.591913845@apps.rackspace.com> Hi, You're in an old part of Boston, close to the sports statium. The area is currently is genrified. I don't know these places, but they are close to your hotel. http://thefours.com/boston/#about-us West End Johnnies Boston Best, Lloyd -----Original Message----- From: "Robert Virding" Sent: Monday, June 1, 2015 3:25pm To: "Christopher Meiklejohn" Cc: "lloyd" , "erlang-questions" , "Steve Vinoski" Subject: Re: [erlang-questions] Erlounge in Boston next week We are staying at the Holiday Inn on 280 Friend St. Our knowledge of Boston is limited. Robert On 1 June 2015 at 15:12, Christopher Meiklejohn wrote: > > > On Jun 1, 2015, at 3:05 PM, lloyd@REDACTED wrote: > > > > Hi Robert, > > > > Let me know where you are staying and I'll see if I can come up with a > place. May depend a bit on how many folks attending the Erlounge. > > Zeeshan Lakhani and I will be in Boston tomorrow, so we?d like to join in. > > Maybe we try for Meadhall in Kendall Square? > > - Chris > > Christopher Meiklejohn > Senior Software Engineer > Basho Technologies, Inc. > cmeiklejohn@REDACTED > > From lloyd@REDACTED Mon Jun 1 22:00:11 2015 From: lloyd@REDACTED (lloyd@REDACTED) Date: Mon, 1 Jun 2015 16:00:11 -0400 (EDT) Subject: [erlang-questions] Erlounge in Boston next week In-Reply-To: <41E75C71-65D1-4AA5-8D16-05FDE8FE013C@basho.com> References: <1433177700.426432534@apps.rackspace.com> <1433185506.400916336@apps.rackspace.com> <41E75C71-65D1-4AA5-8D16-05FDE8FE013C@basho.com> Message-ID: <1433188811.63247011@apps.rackspace.com> Hi, Meadhall is fine with me, though the two restaurants I noted in my previous post are closer to your hotel. But if foks know Meadhall, it may be a better choice depending upon where your training sessions are located. Best, L. -----Original Message----- From: "Christopher Meiklejohn" Sent: Monday, June 1, 2015 3:12pm To: lloyd@REDACTED Cc: "Robert Virding" , "erlang-questions" , "Steve Vinoski" Subject: Re: [erlang-questions] Erlounge in Boston next week > On Jun 1, 2015, at 3:05 PM, lloyd@REDACTED wrote: > > Hi Robert, > > Let me know where you are staying and I'll see if I can come up with a place. May depend a bit on how many folks attending the Erlounge. Zeeshan Lakhani and I will be in Boston tomorrow, so we?d like to join in. Maybe we try for Meadhall in Kendall Square? - Chris Christopher Meiklejohn Senior Software Engineer Basho Technologies, Inc. cmeiklejohn@REDACTED From rvirding@REDACTED Tue Jun 2 14:04:27 2015 From: rvirding@REDACTED (Robert Virding) Date: Tue, 2 Jun 2015 08:04:27 -0400 Subject: [erlang-questions] Erlounge in Boston next week In-Reply-To: <1433188811.63247011@apps.rackspace.com> References: <1433177700.426432534@apps.rackspace.com> <1433185506.400916336@apps.rackspace.com> <41E75C71-65D1-4AA5-8D16-05FDE8FE013C@basho.com> <1433188811.63247011@apps.rackspace.com> Message-ID: Sorry, for the late reply, I zonked last night. Our training sessions are located on State St. The Fours is closer, but we should be able to take the underground to Meadhall. It is the Meadhall in Cambridge center? What about at 7 so we can get back to our hotel and dump our stuff? We can do earlier. It will be great to meet you guys. Robert On 1 June 2015 at 16:00, wrote: > Hi, > > Meadhall is fine with me, though the two restaurants I noted in my > previous post are closer to your hotel. > > But if foks know Meadhall, it may be a better choice depending upon where > your training sessions are located. > > Best, > > L. > > -----Original Message----- > From: "Christopher Meiklejohn" > Sent: Monday, June 1, 2015 3:12pm > To: lloyd@REDACTED > Cc: "Robert Virding" , "erlang-questions" < > erlang-questions@REDACTED>, "Steve Vinoski" > Subject: Re: [erlang-questions] Erlounge in Boston next week > > > > On Jun 1, 2015, at 3:05 PM, lloyd@REDACTED wrote: > > > > Hi Robert, > > > > Let me know where you are staying and I'll see if I can come up with a > place. May depend a bit on how many folks attending the Erlounge. > > Zeeshan Lakhani and I will be in Boston tomorrow, so we?d like to join in. > > Maybe we try for Meadhall in Kendall Square? > > - Chris > > Christopher Meiklejohn > Senior Software Engineer > Basho Technologies, Inc. > cmeiklejohn@REDACTED > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Tue Jun 2 14:16:20 2015 From: vinoski@REDACTED (Steve Vinoski) Date: Tue, 2 Jun 2015 08:16:20 -0400 Subject: [erlang-questions] Erlounge in Boston next week In-Reply-To: References: <1433177700.426432534@apps.rackspace.com> <1433185506.400916336@apps.rackspace.com> <41E75C71-65D1-4AA5-8D16-05FDE8FE013C@basho.com> <1433188811.63247011@apps.rackspace.com> Message-ID: Yes, Meadhall is in Kendall Sq: https://goo.gl/maps/DQgVk 7pm is ok, though I'll be late since I have a bit of a drive to get there. --steve On Tue, Jun 2, 2015 at 8:04 AM, Robert Virding wrote: > Sorry, for the late reply, I zonked last night. Our training sessions are > located on State St. The Fours is closer, but we should be able to take the > underground to Meadhall. It is the Meadhall in Cambridge center? > > What about at 7 so we can get back to our hotel and dump our stuff? We can > do earlier. > > It will be great to meet you guys. > > Robert > > > On 1 June 2015 at 16:00, wrote: > >> Hi, >> >> Meadhall is fine with me, though the two restaurants I noted in my >> previous post are closer to your hotel. >> >> But if foks know Meadhall, it may be a better choice depending upon where >> your training sessions are located. >> >> Best, >> >> L. >> >> -----Original Message----- >> From: "Christopher Meiklejohn" >> Sent: Monday, June 1, 2015 3:12pm >> To: lloyd@REDACTED >> Cc: "Robert Virding" , "erlang-questions" < >> erlang-questions@REDACTED>, "Steve Vinoski" >> Subject: Re: [erlang-questions] Erlounge in Boston next week >> >> >> > On Jun 1, 2015, at 3:05 PM, lloyd@REDACTED wrote: >> > >> > Hi Robert, >> > >> > Let me know where you are staying and I'll see if I can come up with a >> place. May depend a bit on how many folks attending the Erlounge. >> >> Zeeshan Lakhani and I will be in Boston tomorrow, so we?d like to join in. >> >> Maybe we try for Meadhall in Kendall Square? >> >> - Chris >> >> Christopher Meiklejohn >> Senior Software Engineer >> Basho Technologies, Inc. >> cmeiklejohn@REDACTED >> >> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Tue Jun 2 14:19:50 2015 From: henrik@REDACTED (Henrik Nord) Date: Tue, 2 Jun 2015 14:19:50 +0200 Subject: [erlang-questions] Patch package OTP 17.5.6 released Message-ID: <556D9F66.8030703@erlang.org> Patch Package: OTP 17.5.6 Git Tag: OTP-17.5.6 Date: 2015-06-02 System: OTP Release: 17 Application: inets-5.10.9, ssh-3.2.4, ssl-6.0.1 Predecessor: OTP 17.5.5 Check out the git tag OTP-17.5.6, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- inets-5.10.9 ---------------------------------------------------- --------------------------------------------------------------------- The inets-5.10.9 application can be applied independently of other applications on a full OTP 17 installation. --- Improvements and New Features --- OTP-12776 Application(s): inets Add behaviour with optional callbacks to customize the inets HTTP server. Full runtime dependencies of inets-5.10.9: erts-6.0, kernel-3.0, mnesia-4.12, runtime_tools-1.8.14, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --- ssh-3.2.4 ------------------------------------------------------- --------------------------------------------------------------------- Note! The ssh-3.2.4 application can*not* be applied independently of other applications on an arbitrary OTP 17 installation. On a full OTP 17 installation, also the following runtime dependency has to be satisfied: -- stdlib-2.3 (first satisfied in OTP 17.4) --- Fixed Bugs and Malfunctions --- OTP-12782 Application(s): ssh Gracefully terminate if sockets is unexpectedly closed. OTP-12784 Application(s): ssh Made Codenomicon Defensics test suite pass: limit number of algorithms in kexinit message check 'e' and 'f' parameters in kexdh implement 'keyboard-interactive' user authentication on server side return plain text message to bad version exchange message Full runtime dependencies of ssh-3.2.4: crypto-3.3, erts-6.0, kernel-3.0, public_key-0.22, stdlib-2.3 --------------------------------------------------------------------- --- ssl-6.0.1 ------------------------------------------------------- --------------------------------------------------------------------- The ssl-6.0.1 application can be applied independently of other applications on a full OTP 17 installation. --- Fixed Bugs and Malfunctions --- OTP-12783 Application(s): ssl Terminate gracefully when receving bad input to premaster secret calculation Full runtime dependencies of ssl-6.0.1: crypto-3.3, erts-6.0, kernel-3.0, public_key-0.22, stdlib-2.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Tue Jun 2 14:20:48 2015 From: henrik@REDACTED (Henrik Nord) Date: Tue, 2 Jun 2015 14:20:48 +0200 Subject: [erlang-questions] Patch package OTP 17.5.5 released Message-ID: <556D9FA0.20000@erlang.org> Patch Package: OTP 17.5.5 Git Tag: OTP-17.5.5 Date: 2015-05-29 System: OTP Release: 17 Application: diameter-1.9.2 Predecessor: OTP 17.5.4 Check out the git tag OTP-17.5.5, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- diameter-1.9.2 -------------------------------------------------- --------------------------------------------------------------------- The diameter-1.9.2 application can be applied independently of other applications on a full OTP 17 installation. --- Fixed Bugs and Malfunctions --- OTP-12741 Application(s): diameter Fix broken relay counters. OTP-12654 in OTP 17.5.3 broke counters in the case of answer messages received in the relay application. Counters were accumulated as unknown messages or no_result_code instead of as relayed messages on the intended Result-Code and 'Experimental-Result' tuples. OTP-12744 Application(s): diameter Fix diameter_sctp listener race. An oversight in OTP-12428 made it possible to start a transport process that could not establish associations. Full runtime dependencies of diameter-1.9.2: erts-6.0, kernel-3.0, ssl-5.3.4, stdlib-2.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- -- /Henrik Nord Erlang/OTP From kovyl2404@REDACTED Tue Jun 2 17:25:25 2015 From: kovyl2404@REDACTED (Viacheslav V. Kovalev) Date: Tue, 2 Jun 2015 18:25:25 +0300 Subject: [erlang-questions] Dialyzer HOME quirk Message-ID: Hi folks. When working with dialyzer on windows I've noticed some strange (for me) behaviour. To find default PLT location dialyzer peeks into the HOME environment variable, which is... hm... *not always* defined on windows: https://github.com/erlang/otp/blob/maint/lib/dialyzer/src/dialyzer_plt.erl#L230 Erlexec, for example, knows about this fact: https://github.com/erlang/otp/blob/41f2a54d9fed232be06a3c4be06779e9455a62b4/erts/etc/common/erlexec.c#L1523 I believe correct way to locate HOME is to use `init:get_argument(home)`. Does anybody know any reason not to do so? Why dialyzer use os:getenv("HOME") though? From kostis@REDACTED Tue Jun 2 17:35:28 2015 From: kostis@REDACTED (Kostis Sagonas) Date: Tue, 02 Jun 2015 17:35:28 +0200 Subject: [erlang-questions] Dialyzer HOME quirk In-Reply-To: References: Message-ID: <556DCD40.9000206@cs.ntua.gr> On 06/02/2015 05:25 PM, Viacheslav V. Kovalev wrote: > Hi folks. > > When working with dialyzer on windows I've noticed some strange (for > me) behaviour. To find default PLT location dialyzer peeks into the > HOME environment variable, which is... hm...*not always* defined on > windows:https://github.com/erlang/otp/blob/maint/lib/dialyzer/src/dialyzer_plt.erl#L230 > > Erlexec, for example, knows about this fact: > https://github.com/erlang/otp/blob/41f2a54d9fed232be06a3c4be06779e9455a62b4/erts/etc/common/erlexec.c#L1523 > > I believe correct way to locate HOME is to use > `init:get_argument(home)`. Does anybody know any reason not to do so? > Why dialyzer use os:getenv("HOME") though? Because we have never tried Dialyzer on windows (at least when this code was written), simply because we did not (and still do not) have such a machine. The reason is as simple as that. Feel free to submit a pull request that fixes this. I would have done it but I have no way of testing whether the change works on Windows or not. Kostis From sdl.web@REDACTED Wed Jun 3 10:18:14 2015 From: sdl.web@REDACTED (Leo Liu) Date: Wed, 03 Jun 2015 16:18:14 +0800 Subject: [erlang-questions] No crypto:module_info/0,1 Message-ID: Hi there, The manual says the compiler automatically inserts module_info/0,1 in each module but I just discovered that crypto has no such functions. Ideas? Leo From vychodil.hynek@REDACTED Wed Jun 3 10:32:23 2015 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Wed, 3 Jun 2015 10:32:23 +0200 Subject: [erlang-questions] No crypto:module_info/0,1 In-Reply-To: References: Message-ID: erl Erlang/OTP 17 [erts-6.4] [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V6.4 (abort with ^G) 1> application:start start/1 start/2 start_boot/1 start_boot/2 start_type/0 1> application:start(crypto). ok 2> crypto:module_info(). [{exports,[{version,0}, {stop,0}, {supports,0}, {info_lib,0}, {hash,2}, ... On Wed, Jun 3, 2015 at 10:18 AM, Leo Liu wrote: > Hi there, > > The manual says the compiler automatically inserts module_info/0,1 in > each module but I just discovered that crypto has no such functions. > Ideas? > > Leo > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Wed Jun 3 10:32:24 2015 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 03 Jun 2015 11:32:24 +0300 Subject: [erlang-questions] No crypto:module_info/0,1 In-Reply-To: References: Message-ID: <556EBB98.800@ninenines.eu> They exist here. In the shell, m(crypto). doesn't work for you? On 06/03/2015 11:18 AM, Leo Liu wrote: > Hi there, > > The manual says the compiler automatically inserts module_info/0,1 in > each module but I just discovered that crypto has no such functions. > Ideas? > > Leo > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From sdl.web@REDACTED Wed Jun 3 11:36:48 2015 From: sdl.web@REDACTED (Leo Liu) Date: Wed, 03 Jun 2015 17:36:48 +0800 Subject: [erlang-questions] No crypto:module_info/0,1 References: Message-ID: On 2015-06-03 16:32 +0800, Hynek Vychodil wrote: > 2> crypto:module_info(). > [{exports,[{version,0}, > {stop,0}, > {supports,0}, > {info_lib,0}, > {hash,2}, > ... On 2015-06-03 16:32 +0800, Lo?c Hoguin wrote: > They exist here. In the shell, m(crypto). doesn't work for you? Thanks for the confirmation. I have a node somehow missing this. Erlang/OTP 18 [RELEASE CANDIDATE 2] [erts-7.0] [source-23501295] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] m(crypto) prints ** exception error: undefined function crypto:module_info/0 in function c:m/1 (c.erl, line 509) But I can't reproduce this in a newly-started node. Leo From max.feng.bao@REDACTED Wed Jun 3 09:14:20 2015 From: max.feng.bao@REDACTED (max) Date: Wed, 03 Jun 2015 15:14:20 +0800 Subject: [erlang-questions] Multi Pollset Message-ID: <556EA94C.1090507@gmail.com> Hi, I have read the [erlang-patches] Pollset per scheduler and bind port to scheduler, and port bind is a temporary solution. But, how is the 'Multi Pollset' is going on ? And where can I find discussion about 'Multi Pollset' ? Zunbao Feng From tuncer.ayaz@REDACTED Wed Jun 3 12:55:35 2015 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Wed, 3 Jun 2015 12:55:35 +0200 Subject: [erlang-questions] Observer Crashdump Viewer bug? In-Reply-To: <556D4882.2080204@ericsson.com> References: <556D4882.2080204@ericsson.com> Message-ID: On Tue, Jun 2, 2015 at 8:09 AM, Dan Gudmundsson wrote: > I have another branch in testing with crashdump extensions. Thanks, that resolved the warnings. [...] >> WARNING: Found unexpected tag:scheduler >> WARNING: Found unexpected tag:scheduler >> WARNING: Found unexpected line in general information: >> Calling Thread >> WARNING: Found unexpected line in ETS info: >> Chain Length Avg >> [last two lines repeated 20 times] From bchesneau@REDACTED Thu Jun 4 10:03:01 2015 From: bchesneau@REDACTED (Benoit Chesneau) Date: Thu, 04 Jun 2015 08:03:01 +0000 Subject: [erlang-questions] Erlang meetup in Paris Message-ID: We are organising a french meetup about "Erlang and it's ecosystem" on 06-23 in Paris : http://www.meetup.com/Erlang-Paris/events/222956412/ The location is still to define. If you want to talk about your usage of Erlang, Elixir or LFE, the CFP is there: http://goo.gl/forms/fgiU1uqZFE Looking forward to see you there :) - beno?t -------------- next part -------------- An HTML attachment was scrubbed... URL: From sverker.eriksson@REDACTED Thu Jun 4 11:18:38 2015 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Thu, 4 Jun 2015 11:18:38 +0200 Subject: [erlang-questions] Using maps from NIFs In-Reply-To: References: Message-ID: <557017EE.6000705@ericsson.com> master branch now contains docs for the map functions. I also renamed the ErlNifMapIteratorEntry enum constants to _FIRST and _LAST. The old _HEAD and _TAIL still work but are undocumented and deprecated. /Sverker, Erlang/OTP On 05/26/2015 10:29 AM, Knut Nesheim wrote: > Thanks! :-) > > On Tue, May 26, 2015 at 10:13 AM, Sergej Jure?ko > wrote: >> It's not in the documentation yet, but there is an api if you look at >> erl_nif.h >> >> Check for functions with _map in the name. >> https://github.com/erlang/otp/blob/743ed31108ee555db18d9833186865e85e34333e/erts/emulator/beam/erl_nif_api_funcs.h >> >> >> Sergej >> >> On Tue, May 26, 2015 at 10:01 AM, Knut Nesheim wrote: >>> Hey, >>> >>> I would like to work with maps from within NIFs. Looking around the >>> documentation (also for 18-rc2), I can't find anything about such an >>> API. Did I miss it? If not, are there any plans for introducing an API >>> usable from NIFs? >>> >>> Regards >>> Knut >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From andras.boroska@REDACTED Thu Jun 4 17:11:36 2015 From: andras.boroska@REDACTED (=?UTF-8?Q?Boroska_Andr=C3=A1s?=) Date: Thu, 4 Jun 2015 16:11:36 +0100 Subject: [erlang-questions] Compiling Erlang 17 on IBM AIX Message-ID: Hi, With some tweaks I managed to compile R15 on AIX 7.1 on Power7. No big news there exits a freely downloadable rpm already. When I apply the same tweaks and some more to 17.5 the bootstrapping fails at the first invokation of erlc with core dump: "Failed to create main carrier for eheap_alloc" The erlc is linked with the same aix libc the working R15 version uses. There is enough memory available for the user. I am aware that AIX is not supported, still, any help is appreciated. Andras -------------- next part -------------- An HTML attachment was scrubbed... URL: From knutin@REDACTED Thu Jun 4 19:06:49 2015 From: knutin@REDACTED (Knut Nesheim) Date: Thu, 4 Jun 2015 19:06:49 +0200 Subject: [erlang-questions] leex and case-insensitive match Message-ID: Hey list, I'm using leex and ran into a wall when I wanted a case-insensitive match. For my use case "select", "SELECT", "SeLeCt" means exactly the same. The same question was posted some time ago, but without any answer (http://erlang.org/pipermail/erlang-questions/2006-January/018685.html) I figure after 10 years it's worth another shot. Is there any way of making leex do what I want? I had a look through the code, but quickly realised I will need to dig up my Dragon Book if I want to really understand what's going on. Does anyone have any pointers on how I could hack^Wextend leex? Thanks Knut From jesper.louis.andersen@REDACTED Thu Jun 4 20:15:26 2015 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 4 Jun 2015 20:15:26 +0200 Subject: [erlang-questions] leex and case-insensitive match In-Reply-To: References: Message-ID: On Thu, Jun 4, 2015 at 7:06 PM, Knut Nesheim wrote: > For my use case "select", "SELECT", "SeLeCt" means exactly the > same. > I'm not sure I understand this: [jlouis@REDACTED ~]$ cat z.xrl %% Test Definitions. Rules. [sS][eE][lL][eE][cC][tT] : {token, select}. Erlang code. %% Nothing in an erl shell: 4> leex:file("z"). {ok,"./z.erl"} 6> c("z.erl"). {ok,z} 9> [z:string(Str) || Str <- ["select", "SELECT", "SeLeCt"]]. [{ok,[select],1},{ok,[select],1},{ok,[select],1}] Note how the token parses as the same thing. [sS][eE][lL][eE][cC][tT] : {token, {identifier, string:to_lower(TokenChars)}}. should also work, if select is not a keyword, but you want to handle it as an identifier. some Regex engines provides convenience notation for [sS], [eE] etc, but it tends to be rare enough for keywords that you skip it. Another path through the game is the following age-old lexer hack: [jlouis@REDACTED ~]$ cat y.xrl %% Test Definitions. ALPHA = [a-zA-Z] Rules. {ALPHA}* : {token, analyze_alpha(string:to_lower(TokenChars))}. Erlang code. %% Match keywords, and if no keyword matches, regard the token as an identifier analyze_alpha("select") -> select; analyze_alpha(Otherwise) -> {identifier, Otherwise}. 13> leex:file("y"). {ok,"./y.erl"} 14> c("y.erl"). {ok,y} 15> [y:string(Str) || Str <- ["select", "SELECT", "SeLeCt"]]. [{ok,[select],1},{ok,[select],1},{ok,[select],1}] Do any of these work for you? -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Thu Jun 4 20:18:07 2015 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Thu, 4 Jun 2015 20:18:07 +0200 Subject: [erlang-questions] [erlang-patches] Proposal: reinstate pre-built PLT for Dialyzer In-Reply-To: References: Message-ID: On Thu, Jan 23, 2014 at 5:34 PM, Tuncer Ayaz wrote: > On Thu, Jan 23, 2014 at 5:19 PM, Sean Cribbs wrote: >> On Thu, Jan 23, 2014 at 9:56 AM, Tuncer Ayaz wrote: >>> >>> BTW, assuming this gets off the ground, would you suggest >>> distributing the PLT with the tarball or in the git tree? I think >>> the src tarball and maybe a separate tarball make more sense. For >>> reference, my local R16B03 PLT is 4MB. This would also be in line >>> with other generated files like configure scripts (what's generated >>> vs what's edited). In the git tree it would only make sense to be >>> included in a tagged tree, but that may be confusing, so release >>> tarballs make the most sense to me. >> >> >> Neither. If you build OTP from source, it would be built during the >> normal build/install process. If you download a prebuilt binary >> package (Windows or something from ESL or a distribution >> maintainer), the PLT should be included in that package. > > That sounds good to me. bump? From kovyl2404@REDACTED Thu Jun 4 21:22:31 2015 From: kovyl2404@REDACTED (Viacheslav V. Kovalev) Date: Thu, 4 Jun 2015 22:22:31 +0300 Subject: [erlang-questions] open_port, windows, message order Message-ID: Hi list! While fixing rebar3 windows-specific bugs I've encountered pretty odd (at least for me) thing. See below. ``` 1> file:get_cwd(). {ok,"C:/Users/vkovalev/Documents/rebar3"} %% Yup, I'm in rebar3 project root directory. 2> Cmd = {spawn, "cmd /q /c git log -n 1 --pretty=format:\"%h\n\" "}. {spawn,"cmd /q /c git log -n 1 --pretty=format:\"%h\n\" "} 3> Opts = [exit_status, {line, 16384}, use_stdio, stderr_to_stdout, hide]. [exit_status,{line,16384},use_stdio,stderr_to_stdout,hide] %% This is one of things rebar3 does when building something (itself, for example). 4> open_port(Cmd, Opts). #Port<0.489> 5> flush(). Shell got {#Port<0.489>,{exit_status,0}} Shell got {#Port<0.489>,{data,{noeol,"00e2a3b"}}} %% Oops. Note the messages order. ``` Rebar stops to receive messages right after it received `{exit_status, _}` and then it just misses last message. 1. So does erlang define strict order of this messages, incoming from port? I mean `data` message and `exit_status`. If it doesn't, how can I reliably detect that port command is completely done? 2. What if I'll enable `eof` flag? It obviously should arrive only after all data messages received. But can it occur that in some certain cases I'll not receive `eof`? For example, when port program crashes some specific way? Or is it guaranteed that I'll receive `eof` if I ask for it? Sorry, if my thoughts a bit muddled. Thanks! From knutin@REDACTED Thu Jun 4 21:33:38 2015 From: knutin@REDACTED (Knut Nesheim) Date: Thu, 4 Jun 2015 21:33:38 +0200 Subject: [erlang-questions] leex and case-insensitive match In-Reply-To: References: Message-ID: At the moment I'm using the first solution you propose (and proposed by Joel in the old post). It works out fine. It's cumbersome to write and the lexer file becomes huge in my case. The generated module is 8k lines of code. Otherwise, I don't have any problems. What I would like to do in a perfect world is to use the "i" flag found in some regex implementations: /select/i : {token, {select, TokenLine, TokenChars}} Regards Knut On Thu, Jun 4, 2015 at 8:15 PM, Jesper Louis Andersen wrote: > > On Thu, Jun 4, 2015 at 7:06 PM, Knut Nesheim wrote: >> >> For my use case "select", "SELECT", "SeLeCt" means exactly the >> same. > > > I'm not sure I understand this: > > [jlouis@REDACTED ~]$ cat z.xrl > %% Test > > Definitions. > > Rules. > > [sS][eE][lL][eE][cC][tT] : {token, select}. > > Erlang code. > > %% Nothing > > in an erl shell: > > 4> leex:file("z"). > {ok,"./z.erl"} > 6> c("z.erl"). > {ok,z} > 9> [z:string(Str) || Str <- ["select", "SELECT", "SeLeCt"]]. > [{ok,[select],1},{ok,[select],1},{ok,[select],1}] > > Note how the token parses as the same thing. > > [sS][eE][lL][eE][cC][tT] : {token, {identifier, > string:to_lower(TokenChars)}}. > > should also work, if select is not a keyword, but you want to handle it as > an identifier. > > some Regex engines provides convenience notation for [sS], [eE] etc, but it > tends to be rare enough for keywords that you skip it. Another path through > the game is the following age-old lexer hack: > > [jlouis@REDACTED ~]$ cat y.xrl > %% Test > > Definitions. > > ALPHA = [a-zA-Z] > > Rules. > > {ALPHA}* : {token, analyze_alpha(string:to_lower(TokenChars))}. > > Erlang code. > > %% Match keywords, and if no keyword matches, regard the token as an > identifier > analyze_alpha("select") -> select; > analyze_alpha(Otherwise) -> {identifier, Otherwise}. > > 13> leex:file("y"). > {ok,"./y.erl"} > 14> c("y.erl"). > {ok,y} > 15> [y:string(Str) || Str <- ["select", "SELECT", "SeLeCt"]]. > [{ok,[select],1},{ok,[select],1},{ok,[select],1}] > > Do any of these work for you? > > -- > J. From luis.rascao@REDACTED Thu Jun 4 23:04:39 2015 From: luis.rascao@REDACTED (=?UTF-8?B?THVpcyBSYXNjw6Nv?=) Date: Thu, 4 Jun 2015 22:04:39 +0100 Subject: [erlang-questions] Why intra-node messages are copied and not refcounted, rationale? In-Reply-To: References: Message-ID: This may help you in your studies: http://kth.diva-portal.org/smash/get/diva2:392243/FULLTEXT01.pdf On Sat, May 9, 2015 at 4:34 AM, Nahuel Greco wrote: > Thanks Jesper for your crystal clear explanation. I wrongly assumed when > you appended two Refc binaries (via process local ProcBin's) a new > null-data Refc binary were created in the shared heap pointing to the > previous two. Imagining BEAM having the binaries stored in a persistent > data structure schema on a shared refcounted heap, my next thought was "why > not use it for all data structures?". Need to dive more in the BEAM > internals. > > > Saludos, > Nahuel Greco. > > On Thu, May 7, 2015 at 11:27 AM, Jesper Louis Andersen < > jesper.louis.andersen@REDACTED> wrote: > >> >> On Thu, May 7, 2015 at 3:07 PM, Nahuel Greco wrote: >> >>> What's the rationale of accepting a copying cpu/memory overhead? Why a >>> refcounting mechanism like the used for binaries is not desirable for all >>> the data structures? >> >> >> Really good questions! >> >> Why copy and not pass by reference? It is implementation specific, as the >> Erlang language allows for both semantics, and there were a variant of the >> VM which used varying reference-passing tricks in place of the current >> copying solution. The biggest disadvantage is that if you send very large >> messages, then the copying overhead is large and costs performance. But >> there are also some important advantages to copying. Each process can have >> its own heap arena for instance, so this breaks up the memory space into >> many small chunks which can be individually garbage collected. Erlang is a >> soft realtime system, so you can't afford long garbage collection pauses. >> This is usually really good for GC pause times as they can be quite small. >> The second big advantage is that the semantics are the same for local >> processes as well as distributed processes. You *have* to copy if the >> process lives on another node anyway. The third advantage is that data >> becomes local to a process, and thus local to a processing core. There are >> advantages to this model on a system where memory access is highly >> non-uniform, because you can in theory pick memory close to the processing >> core. >> >> As an example, I have been brewing on some latency benchmarks for >> webservers. A sneak peak is the median response time of this test: >> >> out.go: 50.000% 1.72ms >> out.undertow: 50.000% 1.53ms >> out.cowboy: 50.000% 6.33ms >> >> where clearly, Erlang is far slower than a Go or Undertow, a Java-based >> webserver. But once we look at the 99.99th percentile, things are different: >> >> out.go: 99.990% 58.75ms >> out.undertow: 99.990% 47.90ms >> out.cowboy: 99.990% 38.62ms >> >> and at the 99.999th percentile it gets really funny: >> >> out.go: 99.999% 216.45ms >> out.undertow: 99.999% 64.61ms >> out.cowboy: 99.999% 45.09ms >> >> what you see here is garbage collection overhead because you have such >> large heaps to traverse, or that there are some other factor imposing >> additional latency for a few of the calls. >> >> Why not use refcounting? One price of refcounting is unpredictable >> performance. If you ref-count a large list and free it up, then the GC has >> to get rid of this list, and it will take quite some time. Many refcounting >> GC's runs this as a background job to handle this. In fact, Refcounting GCs >> are dual to Mark&Sweep GCs[0]. In the binary heap, a binary can contain no >> pointers, which means reclamation of memory is always constant. >> Furthermore, without optimizations, refcounting GCs tend to perform badly. >> With optimizations, they start to look like Mark&Sweep collectors, as >> written in [0]. >> >> In other words, both decisions are design decisions which tend to yield >> good soft realtime performance on current hardware, and predictable >> performance, especially in the worst case. You may not want a system that >> stalls for at least 216ms every 100.000th call. But there are no rules in >> the Erlang semantics which constrains us from coming up with another >> message passing scheme, should we invent one that is even better. It is >> just that the current behavior is highly desirable in the systems where >> Erlang tend to get used. >> >> [0] >> http://researcher.watson.ibm.com/researcher/files/us-bacon/Bacon04Unified.pdf >> >> >> -- >> J. >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- PGP fingerprint: F708 E141 AE8D 2D38 E1BC DF3D 1719 3EA0 647D 7260 -------------- next part -------------- An HTML attachment was scrubbed... URL: From ok@REDACTED Fri Jun 5 03:52:46 2015 From: ok@REDACTED (ok@REDACTED) Date: Fri, 5 Jun 2015 13:52:46 +1200 Subject: [erlang-questions] leex and case-insensitive match In-Reply-To: References: Message-ID: <6bdb3df753fe70e58da40ea6cc787b04.squirrel@chasm.otago.ac.nz> One issue is exactly what it is you want to do. Do you want all word-like tokens treated case-insensitively? Do you want a specific set of fixed word-like things that you want case-insensitively and an open set not? Are we talking about an SQL dialect here? Does case insensitivity apply to - the ASCII letters - the Latin-1 letters - the cased letters currently in the Basic Multilingual Plane - the cased letters currently anywhere in Unicode - any codepoints that may be designated as cased in past present or future Unicode and does it - require identity of accents or not (one way of writing French preserves accents when you uppercase, another way does not) - pay attention to the current locale (the famous English -vs- Turkish 'what is the capital of "i"' issue) ? It wouldn't actually be all that hard to make re_parse in leex.erl do something with (?i): it's a matter of mapping x to (x|X) where the other-case version of a letter is in Unicode not necessarily a single codepoint. Wait: I tell a lie. Doing _anything_ with Unicode is somewhere between so-hard-big-companies-don't-get-it-right- first-time to beyond-human-powers. From rvirding@REDACTED Fri Jun 5 04:24:03 2015 From: rvirding@REDACTED (Robert Virding) Date: Thu, 4 Jun 2015 22:24:03 -0400 Subject: [erlang-questions] Erlounge in Boston next week In-Reply-To: References: <1433177700.426432534@apps.rackspace.com> <1433185506.400916336@apps.rackspace.com> <41E75C71-65D1-4AA5-8D16-05FDE8FE013C@basho.com> <1433188811.63247011@apps.rackspace.com> Message-ID: Thanks to all who could come to our erlounge. I had a great time and it was fun meeting you all. Until the next time, Robert On 2 June 2015 at 08:16, Steve Vinoski wrote: > Yes, Meadhall is in Kendall Sq: > > https://goo.gl/maps/DQgVk > > 7pm is ok, though I'll be late since I have a bit of a drive to get there. > > --steve > > > On Tue, Jun 2, 2015 at 8:04 AM, Robert Virding wrote: > >> Sorry, for the late reply, I zonked last night. Our training sessions are >> located on State St. The Fours is closer, but we should be able to take the >> underground to Meadhall. It is the Meadhall in Cambridge center? >> >> What about at 7 so we can get back to our hotel and dump our stuff? We >> can do earlier. >> >> It will be great to meet you guys. >> >> Robert >> >> >> On 1 June 2015 at 16:00, wrote: >> >>> Hi, >>> >>> Meadhall is fine with me, though the two restaurants I noted in my >>> previous post are closer to your hotel. >>> >>> But if foks know Meadhall, it may be a better choice depending upon >>> where your training sessions are located. >>> >>> Best, >>> >>> L. >>> >>> -----Original Message----- >>> From: "Christopher Meiklejohn" >>> Sent: Monday, June 1, 2015 3:12pm >>> To: lloyd@REDACTED >>> Cc: "Robert Virding" , "erlang-questions" < >>> erlang-questions@REDACTED>, "Steve Vinoski" >>> Subject: Re: [erlang-questions] Erlounge in Boston next week >>> >>> >>> > On Jun 1, 2015, at 3:05 PM, lloyd@REDACTED wrote: >>> > >>> > Hi Robert, >>> > >>> > Let me know where you are staying and I'll see if I can come up with a >>> place. May depend a bit on how many folks attending the Erlounge. >>> >>> Zeeshan Lakhani and I will be in Boston tomorrow, so we?d like to join >>> in. >>> >>> Maybe we try for Meadhall in Kendall Square? >>> >>> - Chris >>> >>> Christopher Meiklejohn >>> Senior Software Engineer >>> Basho Technologies, Inc. >>> cmeiklejohn@REDACTED >>> >>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Fri Jun 5 04:28:06 2015 From: rvirding@REDACTED (Robert Virding) Date: Thu, 4 Jun 2015 22:28:06 -0400 Subject: [erlang-questions] leex and case-insensitive match In-Reply-To: References: Message-ID: The lexer file would not become smaller if you had some syntax for saying you wanted a case independent match. The way the resulting scanner works means that you would basically get the same set of lexer rules. This a result of the lexer being completely deterministic. It's all in the dragon book. :-) Robert On 4 June 2015 at 15:33, Knut Nesheim wrote: > At the moment I'm using the first solution you propose (and proposed > by Joel in the old post). It works out fine. It's cumbersome to write > and the lexer file becomes huge in my case. The generated module is 8k > lines of code. Otherwise, I don't have any problems. > > What I would like to do in a perfect world is to use the "i" flag > found in some regex implementations: > > /select/i : {token, {select, TokenLine, TokenChars}} > > Regards > Knut > > On Thu, Jun 4, 2015 at 8:15 PM, Jesper Louis Andersen > wrote: > > > > On Thu, Jun 4, 2015 at 7:06 PM, Knut Nesheim wrote: > >> > >> For my use case "select", "SELECT", "SeLeCt" means exactly the > >> same. > > > > > > I'm not sure I understand this: > > > > [jlouis@REDACTED ~]$ cat z.xrl > > %% Test > > > > Definitions. > > > > Rules. > > > > [sS][eE][lL][eE][cC][tT] : {token, select}. > > > > Erlang code. > > > > %% Nothing > > > > in an erl shell: > > > > 4> leex:file("z"). > > {ok,"./z.erl"} > > 6> c("z.erl"). > > {ok,z} > > 9> [z:string(Str) || Str <- ["select", "SELECT", "SeLeCt"]]. > > [{ok,[select],1},{ok,[select],1},{ok,[select],1}] > > > > Note how the token parses as the same thing. > > > > [sS][eE][lL][eE][cC][tT] : {token, {identifier, > > string:to_lower(TokenChars)}}. > > > > should also work, if select is not a keyword, but you want to handle it > as > > an identifier. > > > > some Regex engines provides convenience notation for [sS], [eE] etc, but > it > > tends to be rare enough for keywords that you skip it. Another path > through > > the game is the following age-old lexer hack: > > > > [jlouis@REDACTED ~]$ cat y.xrl > > %% Test > > > > Definitions. > > > > ALPHA = [a-zA-Z] > > > > Rules. > > > > {ALPHA}* : {token, analyze_alpha(string:to_lower(TokenChars))}. > > > > Erlang code. > > > > %% Match keywords, and if no keyword matches, regard the token as an > > identifier > > analyze_alpha("select") -> select; > > analyze_alpha(Otherwise) -> {identifier, Otherwise}. > > > > 13> leex:file("y"). > > {ok,"./y.erl"} > > 14> c("y.erl"). > > {ok,y} > > 15> [y:string(Str) || Str <- ["select", "SELECT", "SeLeCt"]]. > > [{ok,[select],1},{ok,[select],1},{ok,[select],1}] > > > > Do any of these work for you? > > > > -- > > J. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Fri Jun 5 04:34:20 2015 From: rvirding@REDACTED (Robert Virding) Date: Thu, 4 Jun 2015 22:34:20 -0400 Subject: [erlang-questions] Why intra-node messages are copied and not refcounted, rationale? In-Reply-To: References: Message-ID: With refcounting you can easily make an implementation where freeing large structure does not block the system, you do it in small chunks. I think a much worse problem is that in a multi-core/threaded environment if you want to GC shared state you must synchronize and lock data while you are working and this is very expensive. When you GC process heaps separately you can avoid this. Robert On 7 May 2015 at 10:27, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > > On Thu, May 7, 2015 at 3:07 PM, Nahuel Greco wrote: > >> What's the rationale of accepting a copying cpu/memory overhead? Why a >> refcounting mechanism like the used for binaries is not desirable for all >> the data structures? > > > Really good questions! > > Why copy and not pass by reference? It is implementation specific, as the > Erlang language allows for both semantics, and there were a variant of the > VM which used varying reference-passing tricks in place of the current > copying solution. The biggest disadvantage is that if you send very large > messages, then the copying overhead is large and costs performance. But > there are also some important advantages to copying. Each process can have > its own heap arena for instance, so this breaks up the memory space into > many small chunks which can be individually garbage collected. Erlang is a > soft realtime system, so you can't afford long garbage collection pauses. > This is usually really good for GC pause times as they can be quite small. > The second big advantage is that the semantics are the same for local > processes as well as distributed processes. You *have* to copy if the > process lives on another node anyway. The third advantage is that data > becomes local to a process, and thus local to a processing core. There are > advantages to this model on a system where memory access is highly > non-uniform, because you can in theory pick memory close to the processing > core. > > As an example, I have been brewing on some latency benchmarks for > webservers. A sneak peak is the median response time of this test: > > out.go: 50.000% 1.72ms > out.undertow: 50.000% 1.53ms > out.cowboy: 50.000% 6.33ms > > where clearly, Erlang is far slower than a Go or Undertow, a Java-based > webserver. But once we look at the 99.99th percentile, things are different: > > out.go: 99.990% 58.75ms > out.undertow: 99.990% 47.90ms > out.cowboy: 99.990% 38.62ms > > and at the 99.999th percentile it gets really funny: > > out.go: 99.999% 216.45ms > out.undertow: 99.999% 64.61ms > out.cowboy: 99.999% 45.09ms > > what you see here is garbage collection overhead because you have such > large heaps to traverse, or that there are some other factor imposing > additional latency for a few of the calls. > > Why not use refcounting? One price of refcounting is unpredictable > performance. If you ref-count a large list and free it up, then the GC has > to get rid of this list, and it will take quite some time. Many refcounting > GC's runs this as a background job to handle this. In fact, Refcounting GCs > are dual to Mark&Sweep GCs[0]. In the binary heap, a binary can contain no > pointers, which means reclamation of memory is always constant. > Furthermore, without optimizations, refcounting GCs tend to perform badly. > With optimizations, they start to look like Mark&Sweep collectors, as > written in [0]. > > In other words, both decisions are design decisions which tend to yield > good soft realtime performance on current hardware, and predictable > performance, especially in the worst case. You may not want a system that > stalls for at least 216ms every 100.000th call. But there are no rules in > the Erlang semantics which constrains us from coming up with another > message passing scheme, should we invent one that is even better. It is > just that the current behavior is highly desirable in the systems where > Erlang tend to get used. > > [0] > http://researcher.watson.ibm.com/researcher/files/us-bacon/Bacon04Unified.pdf > > > -- > J. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From knutin@REDACTED Fri Jun 5 09:16:55 2015 From: knutin@REDACTED (Knut Nesheim) Date: Fri, 5 Jun 2015 09:16:55 +0200 Subject: [erlang-questions] leex and case-insensitive match In-Reply-To: <6bdb3df753fe70e58da40ea6cc787b04.squirrel@chasm.otago.ac.nz> References: <6bdb3df753fe70e58da40ea6cc787b04.squirrel@chasm.otago.ac.nz> Message-ID: On Fri, Jun 5, 2015 at 3:52 AM, wrote: > Are we talking about an SQL dialect here? Yes, I'm parsing SQL. All keywords are ASCII, while data from the user might be anything. > It wouldn't actually be all that hard to make re_parse in > leex.erl do something with (?i): it's a matter of mapping > x to (x|X) where the other-case version of a letter is in > Unicode not necessarily a single codepoint. Thanks for the tip. I'll have a look. Regards Knut From marc@REDACTED Fri Jun 5 10:17:04 2015 From: marc@REDACTED (Marc Worrell) Date: Fri, 5 Jun 2015 10:17:04 +0200 Subject: [erlang-questions] Code upgrade messages Message-ID: Hi, For Zotonic we would love to be able to know if any Erlang module got a code upgrade (by loading a new version). This because we use the list of exported functions to hook the module into the internal notification systems. Is it possible to have a process that receives a code-upgrade notification for any module in the running Erlang beam.smp? Best, Marc From dszoboszlay@REDACTED Fri Jun 5 10:48:06 2015 From: dszoboszlay@REDACTED (=?UTF-8?Q?D=C3=A1niel_Szoboszlay?=) Date: Fri, 5 Jun 2015 10:48:06 +0200 Subject: [erlang-questions] Code upgrade messages In-Reply-To: References: Message-ID: Hi, I don't know about any such notifications, but you can simply trace the code_server process. It will send a {code_server, {module, M}} message right after loading module M. Cheers, Daniel 2015-06-05 10:17 GMT+02:00 Marc Worrell : > Hi, > > For Zotonic we would love to be able to know if any Erlang module got a > code upgrade (by loading a new version). > This because we use the list of exported functions to hook the module into > the internal notification systems. > > Is it possible to have a process that receives a code-upgrade notification > for any module in the running Erlang beam.smp? > > Best, > > Marc > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From guninalexander@REDACTED Fri Jun 5 12:53:40 2015 From: guninalexander@REDACTED (Alex Gunin) Date: Fri, 5 Jun 2015 13:53:40 +0300 Subject: [erlang-questions] Monitor process on remote node Message-ID: <590BEAAA-5440-49D1-8E0E-7D91D77E08CF@gmail.com> We have two process P1 on node N1 and P2 on node N2. P1 is monitoring P2 and P2 is monitoring P1. Is?t possible after some network failures/problems that P1 receives {?DOWN?,?} message,but P2 does?t. Both process life all this time. From zxq9@REDACTED Fri Jun 5 13:21:10 2015 From: zxq9@REDACTED (zxq9) Date: Fri, 05 Jun 2015 20:21:10 +0900 Subject: [erlang-questions] Monitor process on remote node In-Reply-To: <590BEAAA-5440-49D1-8E0E-7D91D77E08CF@gmail.com> References: <590BEAAA-5440-49D1-8E0E-7D91D77E08CF@gmail.com> Message-ID: <5411618.h4cSVmyJjK@changa> On 2015?6?5? ??? 13:53:40 Alex Gunin wrote: > We have two process P1 on node N1 and P2 on node N2. > P1 is monitoring P2 and P2 is monitoring P1. > Is?t possible after some network failures/problems that P1 receives {?DOWN?,?} message,but P2 does?t. Both process life all this time. >From the perspective of either P1 or P2 there is no difference between a network failure and a process crash: either process becoming unavailable for whatever reason is a failure that generates a 'DOWN' message. There may be some amazing edge case where the gap between N1 and N2 recognizing the network problem is significant, but that is part of why synchronous messaging is built on top of asynchronous messaging (which is true of both OTP 'call' and TCP). Now that I've mentioned TCP, are there cases where one side of the connection doesn't recognize that the connection on the other end has been dropped? Of course -- temporarily. There are brief periods of this that must exist in distributed Erlang as well, but that's part of what timeouts are for. In any case, the runtime's support for monitors and links has been so robust that I've never encountered a situation where a node dropping off introduced unexpected hangs in my system. That is, unless I have let some network fallacies creep into my code... especially when I initially code assuming everything is running within a single node and start cheating here and there for performance. (So far that has always turned out is optimization I never needed anyway! Ugh!) It would be very interesting to learn about the exact mechanism underlying Erlang's distributed monitor/link functionality -- but at the moment I'm too busy trying to solve customer problems to care beyond the fact that it works in a remarkably reliable way. -Craig From guninalexander@REDACTED Fri Jun 5 13:59:53 2015 From: guninalexander@REDACTED (Alex Gunin) Date: Fri, 5 Jun 2015 14:59:53 +0300 Subject: [erlang-questions] Monitor process on remote node In-Reply-To: <5411618.h4cSVmyJjK@changa> References: <590BEAAA-5440-49D1-8E0E-7D91D77E08CF@gmail.com> <5411618.h4cSVmyJjK@changa> Message-ID: <01BE7842-D06E-4D5D-A8A1-5A0CA5311209@gmail.com> Yes. You are right. I explain situation then first node believes that second has died,but second believes that first is alive. I never have this situation too. But in my case I need drop some data in process P2 then P1 stop monitor and must do it with strong guarantees. Does some additional heartbeat messages need for it or I can trust Erlang?s distributed monitor/link functionality. > On 05 Jun 2015, at 14:21, zxq9 wrote: > > On 2015?6?5? ??? 13:53:40 Alex Gunin wrote: >> We have two process P1 on node N1 and P2 on node N2. >> P1 is monitoring P2 and P2 is monitoring P1. >> Is?t possible after some network failures/problems that P1 receives {?DOWN?,?} message,but P2 does?t. Both process life all this time. > > From the perspective of either P1 or P2 there is no difference between a network failure and a process crash: either process becoming unavailable for whatever reason is a failure that generates a 'DOWN' message. > > There may be some amazing edge case where the gap between N1 and N2 recognizing the network problem is significant, but that is part of why synchronous messaging is built on top of asynchronous messaging (which is true of both OTP 'call' and TCP). > > Now that I've mentioned TCP, are there cases where one side of the connection doesn't recognize that the connection on the other end has been dropped? Of course -- temporarily. There are brief periods of this that must exist in distributed Erlang as well, but that's part of what timeouts are for. > > In any case, the runtime's support for monitors and links has been so robust that I've never encountered a situation where a node dropping off introduced unexpected hangs in my system. That is, unless I have let some network fallacies creep into my code... especially when I initially code assuming everything is running within a single node and start cheating here and there for performance. (So far that has always turned out is optimization I never needed anyway! Ugh!) > > It would be very interesting to learn about the exact mechanism underlying Erlang's distributed monitor/link functionality -- but at the moment I'm too busy trying to solve customer problems to care beyond the fact that it works in a remarkably reliable way. > > -Craig > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From tony.m.esposito@REDACTED Fri Jun 5 14:47:18 2015 From: tony.m.esposito@REDACTED (Anthony Esposito) Date: Fri, 05 Jun 2015 12:47:18 +0000 Subject: [erlang-questions] Austin Erlang User Group Logo Message-ID: Hi All, I am wrapping up a logo contest with 99designs.com and need some help selecting a final design for the user group meetup here in Austin, TX. This logo will be used on t-shirts and our website. Austin is famous for Longhorn Bulls so I had the designer incorporate that into the logo ideas. There is an option without it as well. If you could please help me it would be of great assistance. Please look at the variations and rate the one you like the best. Comments are optional and you can vote for just one if you want. http://99designs.com/logo-design/vote-75277d This has been a really hard choice and I really need more opinions. Thanks so much, tony -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Fri Jun 5 17:04:35 2015 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 5 Jun 2015 17:04:35 +0200 Subject: [erlang-questions] Austin Erlang User Group Logo In-Reply-To: References: Message-ID: On Fri, Jun 5, 2015 at 2:47 PM, Anthony Esposito wrote: > Hi All, > > I am wrapping up a logo contest with 99designs.com and need some help > selecting a final design for the user group meetup here in Austin, TX. This > logo will be used on t-shirts and our website. Austin is famous for Longhorn > Bulls so I had the designer incorporate that into the logo ideas. There is > an option without it as well. > > If you could please help me it would be of great assistance. Please look at > the variations and rate the one you like the best. Comments are optional and > you can vote for just one if you want. > > http://99designs.com/logo-design/vote-75277d > > This has been a really hard choice and I really need more opinions. > > Thanks so much, Using horns for T is nice, but what's the difference between #58 and #59? Putting the horns anywhere else doesn't look as nice, if you ask me. I'd drop the colon, so #58 or #59. From tuncer.ayaz@REDACTED Fri Jun 5 17:07:25 2015 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 5 Jun 2015 17:07:25 +0200 Subject: [erlang-questions] [ANN] memo (memoization server) Message-ID: https://github.com/tuncer/memo memo is a simple memoization server that grew out of noticing a pattern in code I was refactoring. Building -------- $ rebar compile or $ erlc +debug_info -o ebin src/*.erl Testing ------- $ rebar ct Dialyzing --------- Build the PLT $ rebar build-plt Run Dialyzer $ rebar dialyze By using abbreviated commands, you can also (0) build-plt, (1) compile, (2) ct (test), and (3) dialyze the code like this: $ rebar b-p $ rebar co ct di This is shorter to type. See 'rebar help' for a description of abbreviated command support. Please take note that the Dialyzer commands require the soon to be released rebar 2.6.0 or current git master. Using ----- Assuming the memo application has been started, you can use it as follows: Instead of Res = mod:expensive_function(A1, A2, [List1]) you call Res = memo:call(mod, expensive_function, [A1, A2, [List1]]) or instead of Res = Fun(A1, A2, [List1]) you call Res = memo:call(Fun, [A1, A2, [List1]]) or instead of Res = mod:expensive_function(A1, A2, [List1]) you call Res = memo:call(fun mod:expensive_function/3, [A1, A2, [List1]]) and any subsequent call will fetch the cached result and avoid the computation. This is of course only useful for expensive computations that are known to produce the same result given same arguments. It's worth mentioning that your call should be side-effect free, as naturally those won't be replayed. The API is simple, and while there was a version that included memo:forget/0 for clearing the cache, it has since been removed. If this is something that is seen as useful for more than debugging purposes, I can add it back. From lenartlad@REDACTED Fri Jun 5 17:35:12 2015 From: lenartlad@REDACTED (Ladislav Lenart) Date: Fri, 05 Jun 2015 17:35:12 +0200 Subject: [erlang-questions] Austin Erlang User Group Logo In-Reply-To: References: Message-ID: <5571C1B0.40709@volny.cz> Hello. On 5.6.2015 17:04, Tuncer Ayaz wrote: > On Fri, Jun 5, 2015 at 2:47 PM, Anthony Esposito wrote: >> Hi All, >> >> I am wrapping up a logo contest with 99designs.com and need some help >> selecting a final design for the user group meetup here in Austin, TX. This >> logo will be used on t-shirts and our website. Austin is famous for Longhorn >> Bulls so I had the designer incorporate that into the logo ideas. There is >> an option without it as well. >> >> If you could please help me it would be of great assistance. Please look at >> the variations and rate the one you like the best. Comments are optional and >> you can vote for just one if you want. >> >> http://99designs.com/logo-design/vote-75277d >> >> This has been a really hard choice and I really need more opinions. >> >> Thanks so much, > > Using horns for T is nice, but what's the difference between > #58 and #59? Putting the horns anywhere else doesn't look > as nice, if you ask me. I'd drop the colon, so #58 or #59. I too like those two best, Ladislav Lenart From essen@REDACTED Fri Jun 5 17:36:13 2015 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Fri, 05 Jun 2015 18:36:13 +0300 Subject: [erlang-questions] Austin Erlang User Group Logo In-Reply-To: <5571C1B0.40709@volny.cz> References: <5571C1B0.40709@volny.cz> Message-ID: <5571C1ED.6080403@ninenines.eu> On 06/05/2015 06:35 PM, Ladislav Lenart wrote: > Hello. > > > On 5.6.2015 17:04, Tuncer Ayaz wrote: >> On Fri, Jun 5, 2015 at 2:47 PM, Anthony Esposito wrote: >>> Hi All, >>> >>> I am wrapping up a logo contest with 99designs.com and need some help >>> selecting a final design for the user group meetup here in Austin, TX. This >>> logo will be used on t-shirts and our website. Austin is famous for Longhorn >>> Bulls so I had the designer incorporate that into the logo ideas. There is >>> an option without it as well. >>> >>> If you could please help me it would be of great assistance. Please look at >>> the variations and rate the one you like the best. Comments are optional and >>> you can vote for just one if you want. >>> >>> http://99designs.com/logo-design/vote-75277d >>> >>> This has been a really hard choice and I really need more opinions. >>> >>> Thanks so much, >> >> Using horns for T is nice, but what's the difference between >> #58 and #59? Putting the horns anywhere else doesn't look >> as nice, if you ask me. I'd drop the colon, so #58 or #59. > > I too like those two best, Same with a preference for #58 though. -- Lo?c Hoguin http://ninenines.eu From mmartin4242@REDACTED Fri Jun 5 17:36:17 2015 From: mmartin4242@REDACTED (Michael L Martin) Date: Fri, 05 Jun 2015 10:36:17 -0500 Subject: [erlang-questions] Austin Erlang User Group Logo In-Reply-To: References: Message-ID: <5571C1F1.3070400@gmail.com> I agree. On 06/05/2015 10:04 AM, Tuncer Ayaz wrote: > On Fri, Jun 5, 2015 at 2:47 PM, Anthony Esposito wrote: >> Hi All, >> >> I am wrapping up a logo contest with 99designs.com and need some help >> selecting a final design for the user group meetup here in Austin, TX. This >> logo will be used on t-shirts and our website. Austin is famous for Longhorn >> Bulls so I had the designer incorporate that into the logo ideas. There is >> an option without it as well. >> >> If you could please help me it would be of great assistance. Please look at >> the variations and rate the one you like the best. Comments are optional and >> you can vote for just one if you want. >> >> http://99designs.com/logo-design/vote-75277d >> >> This has been a really hard choice and I really need more opinions. >> >> Thanks so much, > Using horns for T is nice, but what's the difference between > #58 and #59? Putting the horns anywhere else doesn't look > as nice, if you ask me. I'd drop the colon, so #58 or #59. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From tuncer.ayaz@REDACTED Fri Jun 5 20:06:16 2015 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 5 Jun 2015 20:06:16 +0200 Subject: [erlang-questions] Austin Erlang User Group Logo In-Reply-To: <5571C1ED.6080403@ninenines.eu> References: <5571C1B0.40709@volny.cz> <5571C1ED.6080403@ninenines.eu> Message-ID: On Fri, Jun 5, 2015 at 5:36 PM, Lo?c Hoguin wrote: > On 06/05/2015 06:35 PM, Ladislav Lenart wrote: >> >> Hello. >> >> >> On 5.6.2015 17:04, Tuncer Ayaz wrote: >>> >>> On Fri, Jun 5, 2015 at 2:47 PM, Anthony Esposito wrote: >>>> >>>> Hi All, >>>> >>>> I am wrapping up a logo contest with 99designs.com and need some help >>>> selecting a final design for the user group meetup here in Austin, TX. >>>> This >>>> logo will be used on t-shirts and our website. Austin is famous for >>>> Longhorn >>>> Bulls so I had the designer incorporate that into the logo ideas. There >>>> is >>>> an option without it as well. >>>> >>>> If you could please help me it would be of great assistance. Please look >>>> at >>>> the variations and rate the one you like the best. Comments are optional >>>> and >>>> you can vote for just one if you want. >>>> >>>> http://99designs.com/logo-design/vote-75277d >>>> >>>> This has been a really hard choice and I really need more opinions. >>>> >>>> Thanks so much, >>> >>> >>> Using horns for T is nice, but what's the difference between >>> #58 and #59? Putting the horns anywhere else doesn't look >>> as nice, if you ask me. I'd drop the colon, so #58 or #59. >> >> >> I too like those two best, > > > Same with a preference for #58 though. Yep, now that I found the difference, I agree. #58 looks better, although the E of Erlang is easier to see in #59. I mean, the E in #58 doesn't look as nice, if you look at just the E, but overall the #58's unbroken just lambda looks better. So, #58. From eric.pailleau@REDACTED Sat Jun 6 01:52:44 2015 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Sat, 06 Jun 2015 01:52:44 +0200 Subject: [erlang-questions] Code upgrade messages In-Reply-To: Message-ID: Hi, You may 'simply' have to trace delete_module(Module) used by code server, with dbg or other tracing tools... And catch the Module name. Le?5 juin 2015 10:17, Marc Worrell a ?crit?: > > Hi, > > For Zotonic we would love to be able to know if any Erlang module got a code upgrade (by loading a new version). > This because we use the list of exported functions to hook the module into the internal notification systems. > > Is it possible to have a process that receives a code-upgrade notification for any module in the running Erlang beam.smp? > > Best, > > Marc > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From tony.m.esposito@REDACTED Sat Jun 6 15:35:14 2015 From: tony.m.esposito@REDACTED (Anthony Esposito) Date: Sat, 06 Jun 2015 13:35:14 +0000 Subject: [erlang-questions] Austin Erlang User Group Logo In-Reply-To: References: Message-ID: Hello everyone, Your feedback and support was extremely helpful. I can't express how grateful I am to this community. I'll let everyone know when we get our website up and running, austinerlang.org. I hope to see many of you at EUC next week. Thanks! tony On Fri, Jun 5, 2015 at 7:47 AM Anthony Esposito wrote: > Hi All, > > I am wrapping up a logo contest with 99designs.com and need some help > selecting a final design for the user group meetup here in Austin, TX. This > logo will be used on t-shirts and our website. Austin is famous for > Longhorn Bulls so I had the designer incorporate that into the logo ideas. > There is an option without it as well. > > If you could please help me it would be of great assistance. Please look > at the variations and rate the one you like the best. Comments are optional > and you can vote for just one if you want. > > http://99designs.com/logo-design/vote-75277d > > This has been a really hard choice and I really need more opinions. > > Thanks so much, > tony > -------------- next part -------------- An HTML attachment was scrubbed... URL: From denis.justinek@REDACTED Sun Jun 7 17:12:57 2015 From: denis.justinek@REDACTED (Denis Justinek) Date: Sun, 7 Jun 2015 17:12:57 +0200 Subject: [erlang-questions] SSL connection problem Message-ID: Hello! For the last few days I stared experiencing problems when connecting to Apple Push Notification Service (APNS) with Erlangs SSL. When trying to connect I encounter the following error: ** exception exit: {{function_clause,[{ssl_cipher,hash_algorithm,"?", [{file,"ssl_cipher.erl"},{line,1196}]}, {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, [{file,"ssl_handshake.erl"},{line,945}]}, {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, [{file,"ssl_handshake.erl"},{line,946}]}, {ssl_handshake,decode_handshake,3, [{file,"ssl_handshake.erl"},{line,945}]}, {tls_handshake,get_tls_handshake_aux,3, [{file,"tls_handshake.erl"},{line,155}]}, {tls_connection,next_state,4, [{file,"tls_connection.erl"},{line,433}]}, {tls_connection,next_state,4, [{file,"tls_connection.erl"},{line,437}]}, {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}]}, {gen_fsm,sync_send_all_state_event, [<0.1221.0>,{start,1000},infinity]}} in function gen_fsm:sync_send_all_state_event/3 (gen_fsm.erl, line 242) in call from ssl_connection:sync_send_all_state_event/2 (ssl_connection.erl, line 1654) in call from ssl_connection:handshake/2 (ssl_connection.erl, line 101) in call from tls_connection:start_fsm/8 (tls_connection.erl, line 81) in call from ssl_connection:connect/8 (ssl_connection.erl, line 71) 16:53:13.961 <0.1221.0> Undefined Undefined [error] gen_fsm <0.1221.0> in state certify terminated with reason: no function clause matching ssl_cipher:hash_algorithm(239) line 1196 16:53:13.964 <0.1221.0> Undefined Undefined [error] CRASH REPORT Process <0.1221.0> with 0 neighbours exited with reason: no function clause matching ssl_cipher:hash_algorithm(239) line 1196 in gen_fsm:terminate/7 line 611 16:53:13.965 <0.174.0> Undefined Undefined [error] Supervisor tls_connection_sup had child undefined started with {tls_connection,start_link,undefined} at <0.1221.0> exit with reason no function clause matching ssl_cipher:hash_algorithm(239) line 1196 in context child_terminated Steps to reproduce (you need an APNS certificate for this): application:ensure_all_started(ssl). Address = "gateway.sandbox.push.apple.com". Port = 2195. Cert = "cert.pem". CertPass = "*****". Options1 = [{certfile,Cert},{password,CertPass},{mode,binary}]. Timeout = 1000. {ok,Socket} = ssl:connect(Address, Port, Options1, Timeout). If we try to connect with the same certificate by using OpenSSL from command line (s_client) if works fine with no errors. Terminal command: openssl s_client -connect gateway.sandbox.push.apple.com:2195 -cert cert.pem -debug Enter pass phrase for cert.pem: CONNECTED(00000003) ... Certificate chain 0 s:/C=US/ST=California/L=Cupertino/O=Apple Inc./CN= gateway.sandbox.push.apple.com i:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C 1 s:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C i:/O=Entrust.net/OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification Authority (2048) --- ... subject=/C=US/ST=California/L=Cupertino/O=Apple Inc./CN= gateway.sandbox.push.apple.com issuer=/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C --- No client certificate CA names sent --- SSL handshake has read 2760 bytes and written 2363 bytes --- New, TLSv1/SSLv3, Cipher is AES256-SHA Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE SSL-Session: Protocol : TLSv1 Cipher : AES256-SHA Session-ID: Session-ID-ctx: Master-Key: ... Key-Arg : None Start Time: 1433689177 Timeout : 300 (sec) Verify return code: 0 (ok) --- Is this an issue with Erlang SSL module? How can it be mitigated? This can be reproduced on OSX and Linux - Erlang 17.4. With regards, Denis -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Sun Jun 7 22:27:34 2015 From: g@REDACTED (Guilherme Andrade) Date: Sun, 07 Jun 2015 21:27:34 +0100 Subject: [erlang-questions] SSL connection problem In-Reply-To: References: Message-ID: <5574A936.8060400@gandrade.net> On 07-06-2015 16:12, Denis Justinek wrote: > Hello! > > For the last few days I stared experiencing problems when connecting > to Apple Push Notification Service (APNS) with > Erlangs SSL. Yeah, I've been getting this too, albeit only on the sandbox endpoint; R16B03-1 here. It's rather weird; the TLS 1.2 spec[1] lists the following hashing algorithms: enum { none(0), md5(1), sha1(2), sha224(3), sha256(4), sha384(5), sha512(6), (255) } HashAlgorithm; 239 being 0xEF, it's a rather suspicious bitmask, so I would go with either 1) handshake message being wrongly decoded or 2) something fishy on the their end. [1]: https://www.ietf.org/rfc/rfc5246.txt > > When trying to connect I encounter the following error: > > ** exception exit: {{function_clause,[{ssl_cipher,hash_algorithm,"?", > > [{file,"ssl_cipher.erl"},{line,1196}]}, > > {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, > > [{file,"ssl_handshake.erl"},{line,945}]}, > > {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, > > [{file,"ssl_handshake.erl"},{line,946}]}, > {ssl_handshake,decode_handshake,3, > > [{file,"ssl_handshake.erl"},{line,945}]}, > > {tls_handshake,get_tls_handshake_aux,3, > > [{file,"tls_handshake.erl"},{line,155}]}, > {tls_connection,next_state,4, > > [{file,"tls_connection.erl"},{line,433}]}, > {tls_connection,next_state,4, > > [{file,"tls_connection.erl"},{line,437}]}, > > {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}]}, > {gen_fsm,sync_send_all_state_event, > [<0.1221.0>,{start,1000},infinity]}} > in function gen_fsm:sync_send_all_state_event/3 (gen_fsm.erl, > line 242) > in call from ssl_connection:sync_send_all_state_event/2 > (ssl_connection.erl, line 1654) > in call from ssl_connection:handshake/2 (ssl_connection.erl, line > 101) > in call from tls_connection:start_fsm/8 (tls_connection.erl, line 81) > in call from ssl_connection:connect/8 (ssl_connection.erl, line 71) > 16:53:13.961 <0.1221.0> Undefined Undefined [error] gen_fsm <0.1221.0> > in state certify terminated with reason: no function clause matching > ssl_cipher:hash_algorithm(239) line 1196 > 16:53:13.964 <0.1221.0> Undefined Undefined [error] CRASH REPORT > Process <0.1221.0> with 0 neighbours exited with reason: no function > clause matching ssl_cipher:hash_algorithm(239) line 1196 in > gen_fsm:terminate/7 line 611 > 16:53:13.965 <0.174.0> Undefined Undefined [error] Supervisor > tls_connection_sup had child undefined started with > {tls_connection,start_link,undefined} at <0.1221.0> exit with reason > no function clause matching ssl_cipher:hash_algorithm(239) line 1196 > in context child_terminated > > Steps to reproduce (you need an APNS certificate for this): > > application:ensure_all_started(ssl). > Address = "gateway.sandbox.push.apple.com > ". > Port = 2195. > Cert = "cert.pem". > CertPass = "*****". > Options1 = [{certfile,Cert},{password,CertPass},{mode,binary}]. > Timeout = 1000. > {ok,Socket} = ssl:connect(Address, Port, Options1, Timeout). > > If we try to connect with the same certificate by using OpenSSL from > command line (s_client) if works fine with no errors. > > Terminal command: openssl s_client -connect > gateway.sandbox.push.apple.com:2195 > -cert cert.pem -debug > Enter pass phrase for cert.pem: > CONNECTED(00000003) > ... > Certificate chain > 0 s:/C=US/ST=California/L=Cupertino/O=Apple > Inc./CN=gateway.sandbox.push.apple.com > > i:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa > is incorporated by reference/OU=(c) 2009 > Entrust, Inc./CN=Entrust Certification Authority - L1C > 1 s:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa > is incorporated by reference/OU=(c) 2009 > Entrust, Inc./CN=Entrust Certification Authority - L1C > i:/O=Entrust.net/OU=www.entrust.net/CPS_2048 > incorp. by ref. (limits > liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification > Authority (2048) > --- > ... > subject=/C=US/ST=California/L=Cupertino/O=Apple > Inc./CN=gateway.sandbox.push.apple.com > > issuer=/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa > is incorporated by reference/OU=(c) 2009 > Entrust, Inc./CN=Entrust Certification Authority - L1C > --- > No client certificate CA names sent > --- > SSL handshake has read 2760 bytes and written 2363 bytes > --- > New, TLSv1/SSLv3, Cipher is AES256-SHA > Server public key is 2048 bit > Secure Renegotiation IS supported > Compression: NONE > Expansion: NONE > SSL-Session: > Protocol : TLSv1 > Cipher : AES256-SHA > Session-ID: > Session-ID-ctx: > Master-Key: ... > Key-Arg : None > Start Time: 1433689177 > Timeout : 300 (sec) > Verify return code: 0 (ok) > --- > > Is this an issue with Erlang SSL module? How can it be mitigated? > > This can be reproduced on OSX and Linux - Erlang 17.4. > > With regards, > Denis > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Guilherme https://www.gandrade.net/ PGP: 0x602B2AD8 / B348 C976 CCE1 A02A 017E 4649 7A6E B621 602B 2AD8 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: OpenPGP digital signature URL: From askjuise@REDACTED Sun Jun 7 23:15:19 2015 From: askjuise@REDACTED (Alexander Petrovsky) Date: Mon, 8 Jun 2015 01:15:19 +0400 Subject: [erlang-questions] SSL connection problem In-Reply-To: <5574A936.8060400@gandrade.net> References: <5574A936.8060400@gandrade.net> Message-ID: Hi! Maybe it can help - https://blog.process-one.net/apple-increasing-security-of-push-service-ahead-of-wwdc/ ???????????, 7 ???? 2015 ?. ???????????? Guilherme Andrade ???????: > > On 07-06-2015 16:12, Denis Justinek wrote: > > Hello! > > For the last few days I stared experiencing problems when connecting to > Apple Push Notification Service (APNS) with > Erlangs SSL. > > > Yeah, I've been getting this too, albeit only on the sandbox endpoint; > R16B03-1 here. > > It's rather weird; the TLS 1.2 spec[1] lists the following hashing > algorithms: > > enum { > none(0), md5(1), sha1(2), sha224(3), sha256(4), sha384(5), > sha512(6), (255) > } HashAlgorithm; > > 239 being 0xEF, it's a rather suspicious bitmask, so I would go with > either 1) handshake message being wrongly decoded or 2) something fishy > on the their end. > > > > [1]: https://www.ietf.org/rfc/rfc5246.txt > > > > When trying to connect I encounter the following error: > > ** exception exit: {{function_clause,[{ssl_cipher,hash_algorithm,"?", > > [{file,"ssl_cipher.erl"},{line,1196}]}, > > {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, > > [{file,"ssl_handshake.erl"},{line,945}]}, > > {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, > > [{file,"ssl_handshake.erl"},{line,946}]}, > {ssl_handshake,decode_handshake,3, > > [{file,"ssl_handshake.erl"},{line,945}]}, > > {tls_handshake,get_tls_handshake_aux,3, > > [{file,"tls_handshake.erl"},{line,155}]}, > {tls_connection,next_state,4, > > [{file,"tls_connection.erl"},{line,433}]}, > {tls_connection,next_state,4, > > [{file,"tls_connection.erl"},{line,437}]}, > > {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}]}, > {gen_fsm,sync_send_all_state_event, > [<0.1221.0>,{start,1000},infinity]}} > in function gen_fsm:sync_send_all_state_event/3 (gen_fsm.erl, line > 242) > in call from ssl_connection:sync_send_all_state_event/2 > (ssl_connection.erl, line 1654) > in call from ssl_connection:handshake/2 (ssl_connection.erl, line 101) > in call from tls_connection:start_fsm/8 (tls_connection.erl, line 81) > in call from ssl_connection:connect/8 (ssl_connection.erl, line 71) > 16:53:13.961 <0.1221.0> Undefined Undefined [error] gen_fsm <0.1221.0> in > state certify terminated with reason: no function clause matching > ssl_cipher:hash_algorithm(239) line 1196 > 16:53:13.964 <0.1221.0> Undefined Undefined [error] CRASH REPORT Process > <0.1221.0> with 0 neighbours exited with reason: no function clause > matching ssl_cipher:hash_algorithm(239) line 1196 in gen_fsm:terminate/7 > line 611 > 16:53:13.965 <0.174.0> Undefined Undefined [error] Supervisor > tls_connection_sup had child undefined started with > {tls_connection,start_link,undefined} at <0.1221.0> exit with reason no > function clause matching ssl_cipher:hash_algorithm(239) line 1196 in > context child_terminated > > Steps to reproduce (you need an APNS certificate for this): > > application:ensure_all_started(ssl). > Address = "gateway.sandbox.push.apple.com". > Port = 2195. > Cert = "cert.pem". > CertPass = "*****". > Options1 = [{certfile,Cert},{password,CertPass},{mode,binary}]. > Timeout = 1000. > {ok,Socket} = ssl:connect(Address, Port, Options1, Timeout). > > If we try to connect with the same certificate by using OpenSSL from > command line (s_client) if works fine with no errors. > > Terminal command: openssl s_client -connect > gateway.sandbox.push.apple.com:2195 -cert cert.pem -debug > Enter pass phrase for cert.pem: > CONNECTED(00000003) > ... > Certificate chain > 0 s:/C=US/ST=California/L=Cupertino/O=Apple Inc./CN= > gateway.sandbox.push.apple.com > i:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by > reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C > 1 s:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by > reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C > i:/O=Entrust.net/OU=www.entrust.net/CPS_2048 incorp. by ref. > (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification > Authority (2048) > --- > ... > subject=/C=US/ST=California/L=Cupertino/O=Apple Inc./CN= > gateway.sandbox.push.apple.com > issuer=/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated > by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - > L1C > --- > No client certificate CA names sent > --- > SSL handshake has read 2760 bytes and written 2363 bytes > --- > New, TLSv1/SSLv3, Cipher is AES256-SHA > Server public key is 2048 bit > Secure Renegotiation IS supported > Compression: NONE > Expansion: NONE > SSL-Session: > Protocol : TLSv1 > Cipher : AES256-SHA > Session-ID: > Session-ID-ctx: > Master-Key: ... > Key-Arg : None > Start Time: 1433689177 > Timeout : 300 (sec) > Verify return code: 0 (ok) > --- > > Is this an issue with Erlang SSL module? How can it be mitigated? > > This can be reproduced on OSX and Linux - Erlang 17.4. > > With regards, > Denis > > > _______________________________________________ > erlang-questions mailing listerlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions > > > -- > Guilherme > https://www.gandrade.net/ > PGP: 0x602B2AD8 / B348 C976 CCE1 A02A 017E 4649 7A6E B621 602B 2AD8 > > -- ?????????? ????????? / Alexander Petrovsky, Skype: askjuise Phone: +7 914 8 820 815 -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Sun Jun 7 23:28:02 2015 From: g@REDACTED (Guilherme Andrade) Date: Sun, 07 Jun 2015 22:28:02 +0100 Subject: [erlang-questions] SSL connection problem In-Reply-To: References: <5574A936.8060400@gandrade.net> Message-ID: <5574B762.4060902@gandrade.net> On 07-06-2015 22:15, Alexander Petrovsky wrote: > Hi! > > Maybe it can help > - https://blog.process-one.net/apple-increasing-security-of-push-service-ahead-of-wwdc/ Thank you, very enlightening. It doesn't feel quite safe to fallback to 'null' / 'anon', though? Hmm... > > ???????????, 7 ???? 2015 ?. ???????????? Guilherme Andrade ???????: > > > On 07-06-2015 16:12, Denis Justinek wrote: >> Hello! >> >> For the last few days I stared experiencing problems when >> connecting to Apple Push Notification Service (APNS) with >> Erlangs SSL. > > Yeah, I've been getting this too, albeit only on the sandbox > endpoint; R16B03-1 here. > > It's rather weird; the TLS 1.2 spec[1] lists the following hashing > algorithms: > > enum { > none(0), md5(1), sha1(2), sha224(3), sha256(4), sha384(5), > sha512(6), (255) > } HashAlgorithm; > > 239 being 0xEF, it's a rather suspicious bitmask, so I would go with > either 1) handshake message being wrongly decoded or 2) something fishy > on the their end. > > > > [1]: https://www.ietf.org/rfc/rfc5246.txt > > >> >> When trying to connect I encounter the following error: >> >> ** exception exit: {{function_clause,[{ssl_cipher,hash_algorithm,"?", >> >> [{file,"ssl_cipher.erl"},{line,1196}]}, >> >> {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, >> >> [{file,"ssl_handshake.erl"},{line,945}]}, >> >> {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, >> >> [{file,"ssl_handshake.erl"},{line,946}]}, >> >> {ssl_handshake,decode_handshake,3, >> >> [{file,"ssl_handshake.erl"},{line,945}]}, >> >> {tls_handshake,get_tls_handshake_aux,3, >> >> [{file,"tls_handshake.erl"},{line,155}]}, >> {tls_connection,next_state,4, >> >> [{file,"tls_connection.erl"},{line,433}]}, >> {tls_connection,next_state,4, >> >> [{file,"tls_connection.erl"},{line,437}]}, >> >> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}]}, >> {gen_fsm,sync_send_all_state_event, >> [<0.1221.0>,{start,1000},infinity]}} >> in function gen_fsm:sync_send_all_state_event/3 >> (gen_fsm.erl, line 242) >> in call from ssl_connection:sync_send_all_state_event/2 >> (ssl_connection.erl, line 1654) >> in call from ssl_connection:handshake/2 (ssl_connection.erl, >> line 101) >> in call from tls_connection:start_fsm/8 (tls_connection.erl, >> line 81) >> in call from ssl_connection:connect/8 (ssl_connection.erl, >> line 71) >> 16:53:13.961 <0.1221.0> Undefined Undefined [error] gen_fsm >> <0.1221.0> in state certify terminated with reason: no function >> clause matching ssl_cipher:hash_algorithm(239) line 1196 >> 16:53:13.964 <0.1221.0> Undefined Undefined [error] CRASH REPORT >> Process <0.1221.0> with 0 neighbours exited with reason: no >> function clause matching ssl_cipher:hash_algorithm(239) line 1196 >> in gen_fsm:terminate/7 line 611 >> 16:53:13.965 <0.174.0> Undefined Undefined [error] Supervisor >> tls_connection_sup had child undefined started with >> {tls_connection,start_link,undefined} at <0.1221.0> exit with >> reason no function clause matching ssl_cipher:hash_algorithm(239) >> line 1196 in context child_terminated >> >> Steps to reproduce (you need an APNS certificate for this): >> >> application:ensure_all_started(ssl). >> Address = "gateway.sandbox.push.apple.com >> ". >> Port = 2195. >> Cert = "cert.pem". >> CertPass = "*****". >> Options1 = [{certfile,Cert},{password,CertPass},{mode,binary}]. >> Timeout = 1000. >> {ok,Socket} = ssl:connect(Address, Port, Options1, Timeout). >> >> If we try to connect with the same certificate by using OpenSSL >> from command line (s_client) if works fine with no errors. >> >> Terminal command: openssl s_client -connect >> gateway.sandbox.push.apple.com:2195 >> -cert cert.pem -debug >> Enter pass phrase for cert.pem: >> CONNECTED(00000003) >> ... >> Certificate chain >> 0 s:/C=US/ST=California/L=Cupertino/O=Apple >> Inc./CN=gateway.sandbox.push.apple.com >> >> i:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa >> is incorporated by reference/OU=(c) >> 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C >> 1 s:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa >> is incorporated by reference/OU=(c) >> 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C >> i:/O=Entrust.net/OU=www.entrust.net/CPS_2048 >> incorp. by ref. (limits >> liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net >> Certification Authority (2048) >> --- >> ... >> subject=/C=US/ST=California/L=Cupertino/O=Apple >> Inc./CN=gateway.sandbox.push.apple.com >> >> issuer=/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa >> is incorporated by reference/OU=(c) >> 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C >> --- >> No client certificate CA names sent >> --- >> SSL handshake has read 2760 bytes and written 2363 bytes >> --- >> New, TLSv1/SSLv3, Cipher is AES256-SHA >> Server public key is 2048 bit >> Secure Renegotiation IS supported >> Compression: NONE >> Expansion: NONE >> SSL-Session: >> Protocol : TLSv1 >> Cipher : AES256-SHA >> Session-ID: >> Session-ID-ctx: >> Master-Key: ... >> Key-Arg : None >> Start Time: 1433689177 >> Timeout : 300 (sec) >> Verify return code: 0 (ok) >> --- >> >> Is this an issue with Erlang SSL module? How can it be mitigated? >> >> This can be reproduced on OSX and Linux - Erlang 17.4. >> >> With regards, >> Denis >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > -- > Guilherme > > https://www.gandrade.net/ > PGP: 0x602B2AD8 / B348 C976 CCE1 A02A 017E 4649 7A6E B621 602B 2AD8 > > > > -- > ?????????? ????????? / Alexander Petrovsky, > > Skype: askjuise > Phone: +7 914 8 820 815 > > -- Guilherme https://www.gandrade.net/ PGP: 0x602B2AD8 / B348 C976 CCE1 A02A 017E 4649 7A6E B621 602B 2AD8 -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: OpenPGP digital signature URL: From yjuglaret@REDACTED Mon Jun 8 09:24:44 2015 From: yjuglaret@REDACTED (Yannis Juglaret) Date: Mon, 08 Jun 2015 09:24:44 +0200 Subject: [erlang-questions] SSL connection problem In-Reply-To: <5574B762.4060902@gandrade.net> References: <5574A936.8060400@gandrade.net> <5574B762.4060902@gandrade.net> Message-ID: <5575433C.8080802@gmail.com> Doesn't feel safe indeed. Failure is not a big deal in an Erlang architecture, and there is probably is nothing better to do than failing in this case as you explained in your previous message. So it seems a better idea to just report this, and try to get more information on the origin of the problem. -- Yannis Le 07/06/2015 23:28, Guilherme Andrade a ?crit : > > > On 07-06-2015 22:15, Alexander Petrovsky wrote: >> Hi! >> >> Maybe it can help - >> https://blog.process-one.net/apple-increasing-security-of-push-service-ahead-of-wwdc/ > > Thank you, very enlightening. It doesn't feel quite safe to fallback to > 'null' / 'anon', though? Hmm... > > >> >> ???????????, 7 ???? 2015 ?. ???????????? Guilherme Andrade ???????: >> >> >> On 07-06-2015 16:12, Denis Justinek wrote: >>> Hello! >>> >>> For the last few days I stared experiencing problems when >>> connecting to Apple Push Notification Service (APNS) with >>> Erlangs SSL. >> >> Yeah, I've been getting this too, albeit only on the sandbox >> endpoint; R16B03-1 here. >> >> It's rather weird; the TLS 1.2 spec[1] lists the following hashing >> algorithms: >> >> enum { >> none(0), md5(1), sha1(2), sha224(3), sha256(4), sha384(5), >> sha512(6), (255) >> } HashAlgorithm; >> >> 239 being 0xEF, it's a rather suspicious bitmask, so I would go with >> either 1) handshake message being wrongly decoded or 2) something fishy >> on the their end. >> >> >> >> [1]:https://www.ietf.org/rfc/rfc5246.txt >> >> >>> >>> When trying to connect I encounter the following error: >>> >>> ** exception exit: {{function_clause,[{ssl_cipher,hash_algorithm,"?", >>> [{file,"ssl_cipher.erl"},{line,1196}]}, >>> {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, >>> [{file,"ssl_handshake.erl"},{line,945}]}, >>> {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, >>> [{file,"ssl_handshake.erl"},{line,946}]}, >>> {ssl_handshake,decode_handshake,3, >>> [{file,"ssl_handshake.erl"},{line,945}]}, >>> {tls_handshake,get_tls_handshake_aux,3, >>> [{file,"tls_handshake.erl"},{line,155}]}, >>> {tls_connection,next_state,4, >>> [{file,"tls_connection.erl"},{line,433}]}, >>> {tls_connection,next_state,4, >>> [{file,"tls_connection.erl"},{line,437}]}, >>> {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}]}, >>> {gen_fsm,sync_send_all_state_event, >>> [<0.1221.0>,{start,1000},infinity]}} >>> in function gen_fsm:sync_send_all_state_event/3 >>> (gen_fsm.erl, line 242) >>> in call from ssl_connection:sync_send_all_state_event/2 >>> (ssl_connection.erl, line 1654) >>> in call from ssl_connection:handshake/2 (ssl_connection.erl, >>> line 101) >>> in call from tls_connection:start_fsm/8 (tls_connection.erl, >>> line 81) >>> in call from ssl_connection:connect/8 (ssl_connection.erl, >>> line 71) >>> 16:53:13.961 <0.1221.0> Undefined Undefined [error] gen_fsm >>> <0.1221.0> in state certify terminated with reason: no function >>> clause matching ssl_cipher:hash_algorithm(239) line 1196 >>> 16:53:13.964 <0.1221.0> Undefined Undefined [error] CRASH REPORT >>> Process <0.1221.0> with 0 neighbours exited with reason: no >>> function clause matching ssl_cipher:hash_algorithm(239) line 1196 >>> in gen_fsm:terminate/7 line 611 >>> 16:53:13.965 <0.174.0> Undefined Undefined [error] Supervisor >>> tls_connection_sup had child undefined started with >>> {tls_connection,start_link,undefined} at <0.1221.0> exit with >>> reason no function clause matching ssl_cipher:hash_algorithm(239) >>> line 1196 in context child_terminated >>> >>> Steps to reproduce (you need an APNS certificate for this): >>> >>> application:ensure_all_started(ssl). >>> Address = "gateway.sandbox.push.apple.com >>> ". >>> Port = 2195. >>> Cert = "cert.pem". >>> CertPass = "*****". >>> Options1 = [{certfile,Cert},{password,CertPass},{mode,binary}]. >>> Timeout = 1000. >>> {ok,Socket} = ssl:connect(Address, Port, Options1, Timeout). >>> >>> If we try to connect with the same certificate by using OpenSSL >>> from command line (s_client) if works fine with no errors. >>> >>> Terminal command: openssl s_client -connect >>> gateway.sandbox.push.apple.com:2195 >>> -cert cert.pem -debug >>> Enter pass phrase for cert.pem: >>> CONNECTED(00000003) >>> ... >>> Certificate chain >>> 0 s:/C=US/ST=California/L=Cupertino/O=Apple >>> Inc./CN=gateway.sandbox.push.apple.com >>> >>> i:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa >>> is incorporated by reference/OU=(c) >>> 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C >>> 1 s:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa >>> is incorporated by reference/OU=(c) >>> 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C >>> i:/O=Entrust.net/OU=www.entrust.net/CPS_2048 >>> incorp. by ref. (limits >>> liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net >>> Certification Authority (2048) >>> --- >>> ... >>> subject=/C=US/ST=California/L=Cupertino/O=Apple >>> Inc./CN=gateway.sandbox.push.apple.com >>> >>> issuer=/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa >>> is incorporated by reference/OU=(c) >>> 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C >>> --- >>> No client certificate CA names sent >>> --- >>> SSL handshake has read 2760 bytes and written 2363 bytes >>> --- >>> New, TLSv1/SSLv3, Cipher is AES256-SHA >>> Server public key is 2048 bit >>> Secure Renegotiation IS supported >>> Compression: NONE >>> Expansion: NONE >>> SSL-Session: >>> Protocol : TLSv1 >>> Cipher : AES256-SHA >>> Session-ID: >>> Session-ID-ctx: >>> Master-Key: ... >>> Key-Arg : None >>> Start Time: 1433689177 >>> Timeout : 300 (sec) >>> Verify return code: 0 (ok) >>> --- >>> >>> Is this an issue with Erlang SSL module? How can it be mitigated? >>> >>> This can be reproduced on OSX and Linux - Erlang 17.4. >>> >>> With regards, >>> Denis >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> -- >> Guilherme >> >> https://www.gandrade.net/ >> PGP: 0x602B2AD8 / B348 C976 CCE1 A02A 017E 4649 7A6E B621 602B 2AD8 >> >> >> >> -- >> ?????????? ????????? / Alexander Petrovsky, >> >> Skype: askjuise >> Phone: +7 914 8 820 815 >> >> > > -- > Guilherme > > https://www.gandrade.net/ > PGP: 0x602B2AD8 / B348 C976 CCE1 A02A 017E 4649 7A6E B621 602B 2AD8 > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From ingela.andin@REDACTED Mon Jun 8 10:30:24 2015 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 8 Jun 2015 10:30:24 +0200 Subject: [erlang-questions] SSL connection problem In-Reply-To: References: Message-ID: I think the following patch would solve the problem, in a good way. I am not sure why they send an invalid value instead of no value, but this way invalid values will be ignored and ssl will fallback to default values if there are no valid values in the extension. diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl index 8584e56..fd101ef 100644 --- a/lib/ssl/src/ssl_cipher.erl +++ b/lib/ssl/src/ssl_cipher.erl @@ -1573,8 +1573,9 @@ hash_algorithm(?SHA) -> sha; hash_algorithm(?SHA224) -> sha224; hash_algorithm(?SHA256) -> sha256; hash_algorithm(?SHA384) -> sha384; -hash_algorithm(?SHA512) -> sha512. - +hash_algorithm(?SHA512) -> sha512; +hash_algorithm(_) -> undefined. + sign_algorithm(anon) -> ?ANON; sign_algorithm(rsa) -> ?RSA; sign_algorithm(dsa) -> ?DSA; @@ -1582,7 +1583,8 @@ sign_algorithm(ecdsa) -> ?ECDSA; sign_algorithm(?ANON) -> anon; sign_algorithm(?RSA) -> rsa; sign_algorithm(?DSA) -> dsa; -sign_algorithm(?ECDSA) -> ecdsa. +sign_algorithm(?ECDSA) -> ecdsa; +sign_algorithm(_) -> undefined. hash_size(null) -> 0; diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl index 12a17cb..32da478 100644 --- a/lib/ssl/src/ssl_handshake.erl +++ b/lib/ssl/src/ssl_handshake.erl @@ -587,7 +587,11 @@ select_hashsign(#hash_sign_algos{hash_sign_algos = HashSigns}, Cert, {Major, Min #'OTPCertificate'{tbsCertificate = TBSCert} =public_key:pkix_decode_cert(Cert, otp), #'OTPSubjectPublicKeyInfo'{algorithm = {_,Algo, _}} = TBSCert#'OTPTBSCertificate'.subjectPublicKeyInfo, DefaultHashSign = {_, Sign} = select_hashsign_algs(undefined, Algo, Version), - case lists:filter(fun({sha, dsa}) -> + case lists:filter(fun({_, undefined}) -> %% ignore invalid extension signature values + false; + ({undefined, _}) -> %% ignore invalid extension hash values + false; + ({sha, dsa}) -> true; ({_, dsa}) -> false; Regards Ingela Erlang/OTP team - Ericsson AB 2015-06-07 17:12 GMT+02:00 Denis Justinek : > Hello! > > For the last few days I stared experiencing problems when connecting to > Apple Push Notification Service (APNS) with > Erlangs SSL. > > When trying to connect I encounter the following error: > > ** exception exit: {{function_clause,[{ssl_cipher,hash_algorithm,"?", > > [{file,"ssl_cipher.erl"},{line,1196}]}, > > {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, > > [{file,"ssl_handshake.erl"},{line,945}]}, > > {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, > > [{file,"ssl_handshake.erl"},{line,946}]}, > {ssl_handshake,decode_handshake,3, > > [{file,"ssl_handshake.erl"},{line,945}]}, > > {tls_handshake,get_tls_handshake_aux,3, > > [{file,"tls_handshake.erl"},{line,155}]}, > {tls_connection,next_state,4, > > [{file,"tls_connection.erl"},{line,433}]}, > {tls_connection,next_state,4, > > [{file,"tls_connection.erl"},{line,437}]}, > > {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}]}, > {gen_fsm,sync_send_all_state_event, > [<0.1221.0>,{start,1000},infinity]}} > in function gen_fsm:sync_send_all_state_event/3 (gen_fsm.erl, line > 242) > in call from ssl_connection:sync_send_all_state_event/2 > (ssl_connection.erl, line 1654) > in call from ssl_connection:handshake/2 (ssl_connection.erl, line 101) > in call from tls_connection:start_fsm/8 (tls_connection.erl, line 81) > in call from ssl_connection:connect/8 (ssl_connection.erl, line 71) > 16:53:13.961 <0.1221.0> Undefined Undefined [error] gen_fsm <0.1221.0> in > state certify terminated with reason: no function clause matching > ssl_cipher:hash_algorithm(239) line 1196 > 16:53:13.964 <0.1221.0> Undefined Undefined [error] CRASH REPORT Process > <0.1221.0> with 0 neighbours exited with reason: no function clause > matching ssl_cipher:hash_algorithm(239) line 1196 in gen_fsm:terminate/7 > line 611 > 16:53:13.965 <0.174.0> Undefined Undefined [error] Supervisor > tls_connection_sup had child undefined started with > {tls_connection,start_link,undefined} at <0.1221.0> exit with reason no > function clause matching ssl_cipher:hash_algorithm(239) line 1196 in > context child_terminated > > Steps to reproduce (you need an APNS certificate for this): > > application:ensure_all_started(ssl). > Address = "gateway.sandbox.push.apple.com". > Port = 2195. > Cert = "cert.pem". > CertPass = "*****". > Options1 = [{certfile,Cert},{password,CertPass},{mode,binary}]. > Timeout = 1000. > {ok,Socket} = ssl:connect(Address, Port, Options1, Timeout). > > If we try to connect with the same certificate by using OpenSSL from > command line (s_client) if works fine with no errors. > > Terminal command: openssl s_client -connect > gateway.sandbox.push.apple.com:2195 -cert cert.pem -debug > Enter pass phrase for cert.pem: > CONNECTED(00000003) > ... > Certificate chain > 0 s:/C=US/ST=California/L=Cupertino/O=Apple Inc./CN= > gateway.sandbox.push.apple.com > i:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by > reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C > 1 s:/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated by > reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C > i:/O=Entrust.net/OU=www.entrust.net/CPS_2048 incorp. by ref. > (limits liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification > Authority (2048) > --- > ... > subject=/C=US/ST=California/L=Cupertino/O=Apple Inc./CN= > gateway.sandbox.push.apple.com > issuer=/C=US/O=Entrust, Inc./OU=www.entrust.net/rpa is incorporated > by reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - > L1C > --- > No client certificate CA names sent > --- > SSL handshake has read 2760 bytes and written 2363 bytes > --- > New, TLSv1/SSLv3, Cipher is AES256-SHA > Server public key is 2048 bit > Secure Renegotiation IS supported > Compression: NONE > Expansion: NONE > SSL-Session: > Protocol : TLSv1 > Cipher : AES256-SHA > Session-ID: > Session-ID-ctx: > Master-Key: ... > Key-Arg : None > Start Time: 1433689177 > Timeout : 300 (sec) > Verify return code: 0 (ok) > --- > > Is this an issue with Erlang SSL module? How can it be mitigated? > > This can be reproduced on OSX and Linux - Erlang 17.4. > > With regards, > Denis > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Mon Jun 8 10:32:01 2015 From: g@REDACTED (Guilherme Andrade) Date: Mon, 08 Jun 2015 09:32:01 +0100 Subject: [erlang-questions] SSL connection problem In-Reply-To: <5575433C.8080802@gmail.com> References: <5574A936.8060400@gandrade.net> <5574B762.4060902@gandrade.net> <5575433C.8080802@gmail.com> Message-ID: <876DD6EC-F422-43B1-BD3A-BAA92E7E9105@gandrade.net> Besides, even if one were to argue that this is only a temporary workaround for the issue at hand, it's crucial to realise it will also affect the safety of _any other_ component using the standard crypto lib (i.e. many HTTP clients when working with HTTPS.) Sent from my phone. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From aschultz@REDACTED Mon Jun 8 11:02:23 2015 From: aschultz@REDACTED (Andreas Schultz) Date: Mon, 8 Jun 2015 09:02:23 +0000 (UTC) Subject: [erlang-questions] SSL connection problem In-Reply-To: References: Message-ID: <1274289641.212007.1433754143859.JavaMail.zimbra@tpip.net> Hi, ----- On 8 Jun, 2015, at 10:30, Ingela Andin ingela.andin@REDACTED wrote: > I think the following patch would solve the problem, in a good way. > > I am not sure why they send an invalid value instead of no value, but this way > invalid values will be ignored and ssl will fallback to default values if there > are no valid values in the extension. Some more context on this, RFC 5246, Section 7.4.1.4.1. has this to say about unknown values: Note: this extension is not meaningful for TLS versions prior to 1.2. Clients MUST NOT offer it if they are offering prior versions. However, even if clients do offer it, the rules specified in [TLSEXT] require servers to ignore extensions they do not understand. Also, the Apple server send the extension in question in an "Certificate Request", with the actual value beeing: 0xEF 0xEF (in decimal 239,239). IANA's TLS extension registry (http://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml) defines the range 224-255 for SignatureAlgorithm and HashAlgorithm as "Reserved for Private Use". So it is perfectly valid for the server to send those. Andreas > diff --git a/lib/ssl/src/ssl_cipher.erl > b/lib/ssl/src/ssl_cipher.erl > index 8584e56..fd101ef 100644 > --- a/lib/ssl/src/ssl_cipher.erl > +++ b/lib/ssl/src/ssl_cipher.erl > @@ -1573,8 +1573,9 @@ hash_algorithm(?SHA) -> sha; > hash_algorithm(?SHA224) -> sha224; > hash_algorithm(?SHA256) -> sha256; > hash_algorithm(?SHA384) -> sha384; > -hash_algorithm(?SHA512) -> sha512. > - > +hash_algorithm(?SHA512) -> sha512; > +hash_algorithm(_) -> undefined. > + > sign_algorithm(anon) -> ?ANON; > sign_algorithm(rsa) -> ?RSA; > sign_algorithm(dsa) -> ?DSA; > @@ -1582,7 +1583,8 @@ sign_algorithm(ecdsa) -> ?ECDSA; > sign_algorithm(?ANON) -> anon; > sign_algorithm(?RSA) -> rsa; > sign_algorithm(?DSA) -> dsa; > -sign_algorithm(?ECDSA) -> ecdsa. > +sign_algorithm(?ECDSA) -> ecdsa; > +sign_algorithm(_) -> undefined. > > hash_size(null) -> > 0; > diff --git a/lib/ssl/src/ssl_handshake.erl b/lib/ssl/src/ssl_handshake.erl > index 12a17cb..32da478 100644 > --- a/lib/ssl/src/ssl_handshake.erl > +++ b/lib/ssl/src/ssl_handshake.erl > @@ -587,7 +587,11 @@ select_hashsign(#hash_sign_algos{hash_sign_algos = > HashSigns}, Cert, {Major, Min > #'OTPCertificate'{tbsCertificate = TBSCert} =public_key:pkix_decode_cert(Cert, > otp), > #'OTPSubjectPublicKeyInfo'{algorithm = {_,Algo, _}} = > TBSCert#'OTPTBSCertificate'.subjectPublicKeyInfo, > DefaultHashSign = {_, Sign} = select_hashsign_algs(undefined, Algo, Version), > - case lists:filter(fun({sha, dsa}) -> > + case lists:filter(fun({_, undefined}) -> %% ignore invalid extension signature > values > + false; > + ({undefined, _}) -> %% ignore invalid extension hash values > + false; > + ({sha, dsa}) -> > true; > ({_, dsa}) -> > false; > > Regards Ingela Erlang/OTP team - Ericsson AB > > > > > 2015-06-07 17:12 GMT+02:00 Denis Justinek < denis.justinek@REDACTED > : > > > > Hello! > > For the last few days I stared experiencing problems when connecting to Apple > Push Notification Service (APNS) with > Erlangs SSL. > > When trying to connect I encounter the following error: > > ** exception exit: {{function_clause,[{ssl_cipher,hash_algorithm,"?", > [{file,"ssl_cipher.erl"},{line,1196}]}, > {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, > [{file,"ssl_handshake.erl"},{line,945}]}, > {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, > [{file,"ssl_handshake.erl"},{line,946}]}, > {ssl_handshake,decode_handshake,3, > [{file,"ssl_handshake.erl"},{line,945}]}, > {tls_handshake,get_tls_handshake_aux,3, > [{file,"tls_handshake.erl"},{line,155}]}, > {tls_connection,next_state,4, > [{file,"tls_connection.erl"},{line,433}]}, > {tls_connection,next_state,4, > [{file,"tls_connection.erl"},{line,437}]}, > {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}]}, > {gen_fsm,sync_send_all_state_event, > [<0.1221.0>,{start,1000},infinity]}} > in function gen_fsm:sync_send_all_state_event/3 (gen_fsm.erl, line 242) > in call from ssl_connection:sync_send_all_state_event/2 (ssl_connection.erl, > line 1654) > in call from ssl_connection:handshake/2 (ssl_connection.erl, line 101) > in call from tls_connection:start_fsm/8 (tls_connection.erl, line 81) > in call from ssl_connection:connect/8 (ssl_connection.erl, line 71) > 16:53:13.961 <0.1221.0> Undefined Undefined [error] gen_fsm <0.1221.0> in state > certify terminated with reason: no function clause matching > ssl_cipher:hash_algorithm(239) line 1196 > 16:53:13.964 <0.1221.0> Undefined Undefined [error] CRASH REPORT Process > <0.1221.0> with 0 neighbours exited with reason: no function clause matching > ssl_cipher:hash_algorithm(239) line 1196 in gen_fsm:terminate/7 line 611 > 16:53:13.965 <0.174.0> Undefined Undefined [error] Supervisor tls_connection_sup > had child undefined started with {tls_connection,start_link,undefined} at > <0.1221.0> exit with reason no function clause matching > ssl_cipher:hash_algorithm(239) line 1196 in context child_terminated > > Steps to reproduce (you need an APNS certificate for this): > > application:ensure_all_started(ssl). > Address = " gateway.sandbox.push.apple.com ". > Port = 2195. > Cert = "cert.pem". > CertPass = "*****". > Options1 = [{certfile,Cert},{password,CertPass},{mode,binary}]. > Timeout = 1000. > {ok,Socket} = ssl:connect(Address, Port, Options1, Timeout). > > If we try to connect with the same certificate by using OpenSSL from command > line (s_client) if works fine with no errors. > > Terminal command: openssl s_client -connect gateway.sandbox.push.apple.com:2195 > -cert cert.pem -debug > Enter pass phrase for cert.pem: > CONNECTED(00000003) > ... > Certificate chain > 0 s:/C=US/ST=California/L=Cupertino/O=Apple Inc./CN= > gateway.sandbox.push.apple.com > i:/C=US/O=Entrust, Inc./OU= www.entrust.net/rpa is incorporated by > reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C > 1 s:/C=US/O=Entrust, Inc./OU= www.entrust.net/rpa is incorporated by > reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C > i:/O=Entrust.net/OU= www.entrust.net/CPS_2048 incorp. by ref. (limits > liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification Authority > (2048) > --- > ... > subject=/C=US/ST=California/L=Cupertino/O=Apple Inc./CN= > gateway.sandbox.push.apple.com > issuer=/C=US/O=Entrust, Inc./OU= www.entrust.net/rpa is incorporated by > reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - L1C > --- > No client certificate CA names sent > --- > SSL handshake has read 2760 bytes and written 2363 bytes > --- > New, TLSv1/SSLv3, Cipher is AES256-SHA > Server public key is 2048 bit > Secure Renegotiation IS supported > Compression: NONE > Expansion: NONE > SSL-Session: > Protocol : TLSv1 > Cipher : AES256-SHA > Session-ID: > Session-ID-ctx: > Master-Key: ... > Key-Arg : None > Start Time: 1433689177 > Timeout : 300 (sec) > Verify return code: 0 (ok) > --- > > Is this an issue with Erlang SSL module? How can it be mitigated? > > This can be reproduced on OSX and Linux - Erlang 17.4. > > With regards, > Denis > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- -- Dipl. Inform. Andreas Schultz email: as@REDACTED phone: +49-391-819099-224 mobil: +49-170-2226073 ------------------- enabling your networks ------------------- Travelping GmbH phone: +49-391-819099229 Roentgenstr. 13 fax: +49-391-819099299 D-39108 Magdeburg email: info@REDACTED GERMANY web: http://www.travelping.com Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 -------------------------------------------------------------- From ingela.andin@REDACTED Mon Jun 8 12:01:49 2015 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 8 Jun 2015 12:01:49 +0200 Subject: [erlang-questions] SSL connection problem In-Reply-To: <1274289641.212007.1433754143859.JavaMail.zimbra@tpip.net> References: <1274289641.212007.1433754143859.JavaMail.zimbra@tpip.net> Message-ID: Hi! Humm, well I take the patch back, I was a little to quick there. I will come back with a new patch suggestion. And of course we want to have a full understanding of the problem before making it official, so that we do not break anything else. Regards Ingela Erlang/OTP team -Ericsson AB 2015-06-08 11:02 GMT+02:00 Andreas Schultz : > Hi, > > ----- On 8 Jun, 2015, at 10:30, Ingela Andin ingela.andin@REDACTED wrote: > > > I think the following patch would solve the problem, in a good way. > > > > I am not sure why they send an invalid value instead of no value, but > this way > > invalid values will be ignored and ssl will fallback to default values > if there > > are no valid values in the extension. > > Some more context on this, RFC 5246, Section 7.4.1.4.1. has this to say > about > unknown values: > > Note: this extension is not meaningful for TLS versions prior to 1.2. > Clients MUST NOT offer it if they are offering prior versions. > However, even if clients do offer it, the rules specified in [TLSEXT] > require servers to ignore extensions they do not understand. > > Also, the Apple server send the extension in question in an "Certificate > Request", > with the actual value beeing: 0xEF 0xEF (in decimal 239,239). IANA's TLS > extension > registry ( > http://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml) > defines the range 224-255 for SignatureAlgorithm and HashAlgorithm as > "Reserved for Private Use". So it is perfectly valid for the server to > send those. > > Andreas > > > diff --git a/lib/ssl/src/ssl_cipher.erl > > b/lib/ssl/src/ssl_cipher.erl > > index 8584e56..fd101ef 100644 > > --- a/lib/ssl/src/ssl_cipher.erl > > +++ b/lib/ssl/src/ssl_cipher.erl > > @@ -1573,8 +1573,9 @@ hash_algorithm(?SHA) -> sha; > > hash_algorithm(?SHA224) -> sha224; > > hash_algorithm(?SHA256) -> sha256; > > hash_algorithm(?SHA384) -> sha384; > > -hash_algorithm(?SHA512) -> sha512. > > - > > +hash_algorithm(?SHA512) -> sha512; > > +hash_algorithm(_) -> undefined. > > + > > sign_algorithm(anon) -> ?ANON; > > sign_algorithm(rsa) -> ?RSA; > > sign_algorithm(dsa) -> ?DSA; > > @@ -1582,7 +1583,8 @@ sign_algorithm(ecdsa) -> ?ECDSA; > > sign_algorithm(?ANON) -> anon; > > sign_algorithm(?RSA) -> rsa; > > sign_algorithm(?DSA) -> dsa; > > -sign_algorithm(?ECDSA) -> ecdsa. > > +sign_algorithm(?ECDSA) -> ecdsa; > > +sign_algorithm(_) -> undefined. > > > > hash_size(null) -> > > 0; > > diff --git a/lib/ssl/src/ssl_handshake.erl > b/lib/ssl/src/ssl_handshake.erl > > index 12a17cb..32da478 100644 > > --- a/lib/ssl/src/ssl_handshake.erl > > +++ b/lib/ssl/src/ssl_handshake.erl > > @@ -587,7 +587,11 @@ select_hashsign(#hash_sign_algos{hash_sign_algos = > > HashSigns}, Cert, {Major, Min > > #'OTPCertificate'{tbsCertificate = TBSCert} > =public_key:pkix_decode_cert(Cert, > > otp), > > #'OTPSubjectPublicKeyInfo'{algorithm = {_,Algo, _}} = > > TBSCert#'OTPTBSCertificate'.subjectPublicKeyInfo, > > DefaultHashSign = {_, Sign} = select_hashsign_algs(undefined, Algo, > Version), > > - case lists:filter(fun({sha, dsa}) -> > > + case lists:filter(fun({_, undefined}) -> %% ignore invalid extension > signature > > values > > + false; > > + ({undefined, _}) -> %% ignore invalid extension hash values > > + false; > > + ({sha, dsa}) -> > > true; > > ({_, dsa}) -> > > false; > > > > Regards Ingela Erlang/OTP team - Ericsson AB > > > > > > > > > > 2015-06-07 17:12 GMT+02:00 Denis Justinek < denis.justinek@REDACTED > : > > > > > > > > Hello! > > > > For the last few days I stared experiencing problems when connecting to > Apple > > Push Notification Service (APNS) with > > Erlangs SSL. > > > > When trying to connect I encounter the following error: > > > > ** exception exit: {{function_clause,[{ssl_cipher,hash_algorithm,"?", > > [{file,"ssl_cipher.erl"},{line,1196}]}, > > {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, > > [{file,"ssl_handshake.erl"},{line,945}]}, > > {ssl_handshake,'-decode_handshake/3-lc$^0/1-0-',1, > > [{file,"ssl_handshake.erl"},{line,946}]}, > > {ssl_handshake,decode_handshake,3, > > [{file,"ssl_handshake.erl"},{line,945}]}, > > {tls_handshake,get_tls_handshake_aux,3, > > [{file,"tls_handshake.erl"},{line,155}]}, > > {tls_connection,next_state,4, > > [{file,"tls_connection.erl"},{line,433}]}, > > {tls_connection,next_state,4, > > [{file,"tls_connection.erl"},{line,437}]}, > > {gen_fsm,handle_msg,7,[{file,"gen_fsm.erl"},{line,503}]}]}, > > {gen_fsm,sync_send_all_state_event, > > [<0.1221.0>,{start,1000},infinity]}} > > in function gen_fsm:sync_send_all_state_event/3 (gen_fsm.erl, line 242) > > in call from ssl_connection:sync_send_all_state_event/2 > (ssl_connection.erl, > > line 1654) > > in call from ssl_connection:handshake/2 (ssl_connection.erl, line 101) > > in call from tls_connection:start_fsm/8 (tls_connection.erl, line 81) > > in call from ssl_connection:connect/8 (ssl_connection.erl, line 71) > > 16:53:13.961 <0.1221.0> Undefined Undefined [error] gen_fsm <0.1221.0> > in state > > certify terminated with reason: no function clause matching > > ssl_cipher:hash_algorithm(239) line 1196 > > 16:53:13.964 <0.1221.0> Undefined Undefined [error] CRASH REPORT Process > > <0.1221.0> with 0 neighbours exited with reason: no function clause > matching > > ssl_cipher:hash_algorithm(239) line 1196 in gen_fsm:terminate/7 line 611 > > 16:53:13.965 <0.174.0> Undefined Undefined [error] Supervisor > tls_connection_sup > > had child undefined started with {tls_connection,start_link,undefined} at > > <0.1221.0> exit with reason no function clause matching > > ssl_cipher:hash_algorithm(239) line 1196 in context child_terminated > > > > Steps to reproduce (you need an APNS certificate for this): > > > > application:ensure_all_started(ssl). > > Address = " gateway.sandbox.push.apple.com ". > > Port = 2195. > > Cert = "cert.pem". > > CertPass = "*****". > > Options1 = [{certfile,Cert},{password,CertPass},{mode,binary}]. > > Timeout = 1000. > > {ok,Socket} = ssl:connect(Address, Port, Options1, Timeout). > > > > If we try to connect with the same certificate by using OpenSSL from > command > > line (s_client) if works fine with no errors. > > > > Terminal command: openssl s_client -connect > gateway.sandbox.push.apple.com:2195 > > -cert cert.pem -debug > > Enter pass phrase for cert.pem: > > CONNECTED(00000003) > > ... > > Certificate chain > > 0 s:/C=US/ST=California/L=Cupertino/O=Apple Inc./CN= > > gateway.sandbox.push.apple.com > > i:/C=US/O=Entrust, Inc./OU= www.entrust.net/rpa is incorporated by > > reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - > L1C > > 1 s:/C=US/O=Entrust, Inc./OU= www.entrust.net/rpa is incorporated by > > reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - > L1C > > i:/O=Entrust.net/OU= www.entrust.net/CPS_2048 incorp. by ref. (limits > > liab.)/OU=(c) 1999 Entrust.net Limited/CN=Entrust.net Certification > Authority > > (2048) > > --- > > ... > > subject=/C=US/ST=California/L=Cupertino/O=Apple Inc./CN= > > gateway.sandbox.push.apple.com > > issuer=/C=US/O=Entrust, Inc./OU= www.entrust.net/rpa is incorporated by > > reference/OU=(c) 2009 Entrust, Inc./CN=Entrust Certification Authority - > L1C > > --- > > No client certificate CA names sent > > --- > > SSL handshake has read 2760 bytes and written 2363 bytes > > --- > > New, TLSv1/SSLv3, Cipher is AES256-SHA > > Server public key is 2048 bit > > Secure Renegotiation IS supported > > Compression: NONE > > Expansion: NONE > > SSL-Session: > > Protocol : TLSv1 > > Cipher : AES256-SHA > > Session-ID: > > Session-ID-ctx: > > Master-Key: ... > > Key-Arg : None > > Start Time: 1433689177 > > Timeout : 300 (sec) > > Verify return code: 0 (ok) > > --- > > > > Is this an issue with Erlang SSL module? How can it be mitigated? > > > > This can be reproduced on OSX and Linux - Erlang 17.4. > > > > With regards, > > Denis > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -- > -- > Dipl. Inform. > Andreas Schultz > > email: as@REDACTED > phone: +49-391-819099-224 > mobil: +49-170-2226073 > > ------------------- enabling your networks ------------------- > > Travelping GmbH phone: +49-391-819099229 > Roentgenstr. 13 fax: +49-391-819099299 > D-39108 Magdeburg email: info@REDACTED > GERMANY web: http://www.travelping.com > > Company Registration: Amtsgericht Stendal Reg No.: HRB 10578 > Geschaeftsfuehrer: Holger Winkelmann | VAT ID No.: DE236673780 > -------------------------------------------------------------- > -------------- next part -------------- An HTML attachment was scrubbed... URL: From xramtsov@REDACTED Mon Jun 8 12:20:10 2015 From: xramtsov@REDACTED (Evgeny Khramtsov) Date: Mon, 8 Jun 2015 13:20:10 +0300 Subject: [erlang-questions] SSL connection problem In-Reply-To: <1274289641.212007.1433754143859.JavaMail.zimbra@tpip.net> References: <1274289641.212007.1433754143859.JavaMail.zimbra@tpip.net> Message-ID: <20150608132010.4179bca8@zinid.ru> Mon, 8 Jun 2015 09:02:23 +0000 (UTC) Andreas Schultz wrote: > Also, the Apple server send the extension in question in an > "Certificate Request", with the actual value beeing: 0xEF 0xEF (in > decimal 239,239). In fact there are 3 undefined values in the request: 239, 238 and 237 for both hash and signature algorithm. The complete sequence looks like this: [{sha512,rsa}, {sha512,dsa}, {sha512,ecdsa}, {239,239}, {sha384,rsa}, {sha384,dsa}, {sha384,ecdsa}, {sha256,rsa}, {sha256,dsa}, {sha256,ecdsa}, {238,238}, {237,237}, {sha224,rsa}, {sha224,dsa}, {sha224,ecdsa}, {sha,rsa}, {sha,dsa}, {sha,ecdsa}]. From marc@REDACTED Mon Jun 8 12:20:41 2015 From: marc@REDACTED (Marc Worrell) Date: Mon, 8 Jun 2015 12:20:41 +0200 Subject: [erlang-questions] Code upgrade messages In-Reply-To: References: Message-ID: <905FF950-92EE-4960-97B2-CADACC4AC2A2@worrell.nl> Hi, Thanks for the suggestions and the idea to trace the code_server. I have checked the code_server source code, and added a trace on the post_beam_load/1 function. erlang:trace_pattern( {code_server, post_beam_load, '_'}, [{'_',[],[{return_trace}]}], % dbg:fun2ms(fun(_) -> return_trace() end) [local]), erlang:trace(whereis(code_server), true, [call]), Now is hoping that that function is ?stable? between releases :) Thanks, Marc > On 6 jun. 2015, at 01:52, ?ric Pailleau wrote: > > Hi, > You may 'simply' have to trace > delete_module(Module) > used by code server, with dbg or other tracing tools... And catch the Module name. > > Le 5 juin 2015 10:17, Marc Worrell a ?crit : >> >> Hi, >> >> For Zotonic we would love to be able to know if any Erlang module got a code upgrade (by loading a new version). >> This because we use the list of exported functions to hook the module into the internal notification systems. >> >> Is it possible to have a process that receives a code-upgrade notification for any module in the running Erlang beam.smp? >> >> Best, >> >> Marc >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From ingela.andin@REDACTED Mon Jun 8 15:08:37 2015 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 8 Jun 2015 15:08:37 +0200 Subject: [erlang-questions] SSL connection problem In-Reply-To: <20150608132010.4179bca8@zinid.ru> References: <1274289641.212007.1433754143859.JavaMail.zimbra@tpip.net> <20150608132010.4179bca8@zinid.ru> Message-ID: Hi! Ok, the following patch should take away the crash and hopefully make it possible negotiate a valid connection (without making things unsafe), in the short perspective. In a longer perspective we probably will want to add some kind of callbacks to let the application handle proprietary algorithms in the certificate-request and in the client hello. We will also consider adding code for ignoring valid but currently not specified codes. diff --git a/lib/ssl/src/ssl_cipher.erl b/lib/ssl/src/ssl_cipher.erl index 3ed53b7..0039f24 100644 --- a/lib/ssl/src/ssl_cipher.erl +++ b/lib/ssl/src/ssl_cipher.erl @@ -1574,8 +1574,8 @@ hash_algorithm(?SHA224) -> sha224; hash_algorithm(?SHA256) -> sha256; hash_algorithm(?SHA384) -> sha384; hash_algorithm(?SHA512) -> sha512; -hash_algorithm(Other) when is_integer(Other) -> Other. - +hash_algorithm(Other) when is_integer(Other) andalso ((Other >= 224) and (Other =< 255)) -> Other. + sign_algorithm(anon) -> ?ANON; sign_algorithm(rsa) -> ?RSA; sign_algorithm(dsa) -> ?DSA; @@ -1584,7 +1584,7 @@ sign_algorithm(?ANON) -> anon; sign_algorithm(?RSA) -> rsa; sign_algorithm(?DSA) -> dsa; sign_algorithm(?ECDSA) -> ecdsa; -sign_algorithm(Other) when is_integer(Other) -> Other. +sign_algorithm(Other) when is_integer(Other) andalso ((Other >= 224) and (Other =< 255)) -> Other. hash_size(null) -> 0; Regards Ingela Erlang/OTP Team - Ericsson AB 2015-06-08 12:20 GMT+02:00 Evgeny Khramtsov : > Mon, 8 Jun 2015 09:02:23 +0000 (UTC) > Andreas Schultz wrote: > > > Also, the Apple server send the extension in question in an > > "Certificate Request", with the actual value beeing: 0xEF 0xEF (in > > decimal 239,239). > > In fact there are 3 undefined values in the request: 239, 238 and 237 > for both hash and signature algorithm. The complete sequence looks like > this: > [{sha512,rsa}, > {sha512,dsa}, > {sha512,ecdsa}, > {239,239}, > {sha384,rsa}, > {sha384,dsa}, > {sha384,ecdsa}, > {sha256,rsa}, > {sha256,dsa}, > {sha256,ecdsa}, > {238,238}, > {237,237}, > {sha224,rsa}, > {sha224,dsa}, > {sha224,ecdsa}, > {sha,rsa}, > {sha,dsa}, > {sha,ecdsa}]. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.pailleau@REDACTED Mon Jun 8 20:53:30 2015 From: eric.pailleau@REDACTED (=?ISO-8859-1?Q?=C9ric_Pailleau?=) Date: Mon, 08 Jun 2015 20:53:30 +0200 Subject: [erlang-questions] Code upgrade messages In-Reply-To: <905FF950-92EE-4960-97B2-CADACC4AC2A2@worrell.nl> Message-ID: Hi, Catch a special case on code_server module upgrade... ;-) Le?8 juin 2015 12:20, Marc Worrell a ?crit?: > > Hi, > > Thanks for the suggestions and the idea to trace the code_server. > I have checked the code_server source code, and added a trace on the post_beam_load/1 function. > > > ??? erlang:trace_pattern( > ????????????????? {code_server, post_beam_load, '_'}, > ????????????????? [{'_',[],[{return_trace}]}],? % dbg:fun2ms(fun(_) -> return_trace() end) > ????????????????? [local]), > ??? erlang:trace(whereis(code_server), true, [call]), > > > Now is hoping that that function is ?stable? between releases :) > > Thanks, > > Marc > > > > On 6 jun. 2015, at 01:52, ?ric Pailleau wrote: > > > > Hi, > > You may 'simply' have to trace > > delete_module(Module) > > used by code server, with dbg or other tracing tools... And catch the Module name. > > > > Le 5 juin 2015 10:17, Marc Worrell a ?crit : > >> > >> Hi, > >> > >> For Zotonic we would love to be able to know if any Erlang module got a code upgrade (by loading a new version). > >> This because we use the list of exported functions to hook the module into the internal notification systems. > >> > >> Is it possible to have a process that receives a code-upgrade notification for any module in the running Erlang beam.smp? > >> > >> Best, > >> > >> Marc > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-questions > From Fabio.Souto@REDACTED Tue Jun 9 11:42:02 2015 From: Fabio.Souto@REDACTED (Fabio Souto) Date: Tue, 9 Jun 2015 09:42:02 +0000 Subject: [erlang-questions] Parametrized queries in mysql-otp Message-ID: Hello fellows, I?m implementing a project that uses mysql-otp for some of its components. At one point, I have to do an INSERT statement with an ON DUPLICATE KEY clause. What happens is that on the ON DUPLICATE KEY statement, I only want to use the last parameter of the parameter list I provide in the query() call. I can?t find a way to name parameters in the parametrized query. Was wondering if anyone had similar experience before. Below follows a generic example of what I?m trying to achieve. ok = mysql_poolboy:query(?DB_POOL_NAME, "INSERT INTO `X` (`a`, `b`, `c`, `d`, `e`) VALUES (?, ?, 1, 0, ?) ON DUPLICATE KEY UPDATE c = c + 1, d = 0, e = ?", [A, B, C]); I want e = C, in the duplicate key statement. Right now, as it is, I?m not sure of what the behaviour will be, but e will probably be e = A. Cheers, -- F?bio S. Team Rocket -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4287 bytes Desc: not available URL: From vychodil.hynek@REDACTED Tue Jun 9 13:50:51 2015 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 9 Jun 2015 13:50:51 +0200 Subject: [erlang-questions] Parametrized queries in mysql-otp In-Reply-To: References: Message-ID: ok = mysql_poolboy:query(?DB_POOL_NAME, "INSERT INTO `X` (`a`, `b`, `c`, `d`, `e`) VALUES (?, ?, 1, 0, ?) ON DUPLICATE KEY UPDATE c = c + 1, d = 0, e = ?", [A, B, C, C]); Doesn't work? On Tue, Jun 9, 2015 at 11:42 AM, Fabio Souto wrote: > Hello fellows, > > I?m implementing a project that uses mysql-otp for some of its components. > At one point, I have to do an INSERT statement with an ON DUPLICATE KEY > clause. > What happens is that on the ON DUPLICATE KEY statement, I only want to use > the last parameter of the parameter list I provide in the query() call. > I can?t find a way to name parameters in the parametrized query. Was > wondering if anyone had similar experience before. > > Below follows a generic example of what I?m trying to achieve. > > ok = mysql_poolboy:query(?DB_POOL_NAME, > "INSERT INTO `X` (`a`, `b`, `c`, `d`, `e`) VALUES (?, ?, 1, 0, ?) > ON DUPLICATE KEY > UPDATE c = c + 1, d = 0, e = ?", > [A, B, C]); > > I want e = C, in the duplicate key statement. Right now, as it is, I?m not > sure of what the behaviour will be, but e will probably be e = A. > > Cheers, > -- > > *F?bio S.* > > *Team Rocket* > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From guidao1013@REDACTED Tue Jun 9 13:32:50 2015 From: guidao1013@REDACTED (Dao Gui) Date: Tue, 9 Jun 2015 19:32:50 +0800 Subject: [erlang-questions] =?utf-8?q?Why_use_send=5Fafter_to_send_a_messa?= =?utf-8?q?ge_is_reverse=EF=BC=9F?= Message-ID: talk is cheap, show the code. ^_^ -module(t). -export([main/0]). main() -> Pid = spawn(fun()->test2() end), erlang:send_after(1000,Pid, 1), erlang:send_after(1000,Pid,2). test2() -> receive A -> io:format("dddd:~p~n",[A]), test2() end. -------------------------------------------------------------------------------------------------------- this output is: dddd:2 dddd:1 then , I find this in time.c * /* insert at head of list at slot */* * p->next = tiw[tm];* * p->prev = NULL;* * if (p->next != NULL)* * p->next->prev = p;* * tiw[tm] = p;* it insert head when we insert message */* Remove from list */* *remove_timer(p);* **timeout_tail = p; /* Insert in timeout queue */* *timeout_tail = &p->next;* it insert tail when it timeout. ---------------------------------------------------------------------------- Q: but why ? if message timeout, we can insert head. it can keep the order of message. why don't do this? other: my English is poor. if something wrong, i hope you forgive me. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jmonserrate@REDACTED Tue Jun 9 15:00:29 2015 From: jmonserrate@REDACTED (Jamie Monserrate) Date: Tue, 9 Jun 2015 14:00:29 +0100 Subject: [erlang-questions] Question regarding CVE-2015-3210 Message-ID: Hello, I am using erlang_otp version 17.1. I had a couple of questions regarding CVE-2015-3210 (more info on implications of the issue here). 1. I noticed that erlang uses a patched version of pcre v8.33. Is your patched version vulnerable to the exploit described in the CVE? 2. If so, would you please be able to give me a rough timescale of when you'll be patching it/upgrading to a new version of pcre that does not have this vulnerability? Thanks a lot in advance. Jamie -------------- next part -------------- An HTML attachment was scrubbed... URL: From vychodil.hynek@REDACTED Tue Jun 9 15:14:48 2015 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 9 Jun 2015 15:14:48 +0200 Subject: [erlang-questions] =?utf-8?q?Why_use_send=5Fafter_to_send_a_messa?= =?utf-8?q?ge_is_reverse=EF=BC=9F?= In-Reply-To: References: Message-ID: Isn't it obvious? Appending head is O(1) operation, removing head is also O(1) operation. Since there is not any guarantee in which order messages should be returned, it is the obvious simplest solution. Your testing code is very uncommon in a real application. There are usually two different processes which schedule messages and the effect is unnoticeable because their ordering is not defined. On Tue, Jun 9, 2015 at 1:32 PM, Dao Gui wrote: > talk is cheap, show the code. ^_^ > > -module(t). > -export([main/0]). > main() -> > Pid = spawn(fun()->test2() end), > erlang:send_after(1000,Pid, 1), > erlang:send_after(1000,Pid,2). > test2() -> > > receive > A -> > io:format("dddd:~p~n",[A]), > test2() > end. > > > -------------------------------------------------------------------------------------------------------- > this output is: > dddd:2 > dddd:1 > > then , I find this in time.c > > * /* insert at head of list at slot */* > * p->next = tiw[tm];* > * p->prev = NULL;* > * if (p->next != NULL)* > * p->next->prev = p;* > * tiw[tm] = p;* > > it insert head when we insert message > > > */* Remove from list */* > *remove_timer(p);* > **timeout_tail = p; /* Insert in timeout queue */* > *timeout_tail = &p->next;* > > it insert tail when it timeout. > > > ---------------------------------------------------------------------------- > Q: but why ? if message timeout, we can insert head. it can keep the order > of message. why don't do this? > > other: my English is poor. if something wrong, i hope you forgive me. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Tue Jun 9 15:25:57 2015 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Tue, 9 Jun 2015 15:25:57 +0200 Subject: [erlang-questions] =?utf-8?q?Why_use_send=5Fafter_to_send_a_messa?= =?utf-8?q?ge_is_reverse=EF=BC=9F?= In-Reply-To: References: Message-ID: On Tue, Jun 9, 2015 at 1:32 PM, Dao Gui wrote: > this output is: > dddd:2 > dddd:1 > Not always! Suppose we have: erlang:send_after(1000,Pid, 1), timer:sleep(1), %% Simulate that we get broken here and other work has to be carried out erlang:send_after(1000,Pid,2). Then the answer is dddd:1 dddd:2 In other words, you better not rely on messages sent in the same time slot have the same ordering every time around. In R18, with multiple timer wheels, the situation is even more nondeterministic. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From danc@REDACTED Tue Jun 9 19:05:33 2015 From: danc@REDACTED (Dan Checkoway) Date: Tue, 9 Jun 2015 13:05:33 -0400 Subject: [erlang-questions] SSL connection problem Message-ID: Hello, I wanted to report my findings having applied both versions of the patch. The first thing we tried was Ingela's most recent suggestion: http://erlang.org/pipermail/erlang-questions/2015-June/084874.html That worked perfectly for APNs connections, but it had some strange side effects in other areas of our application using SSL. We then tried the originally suggested patch: http://erlang.org/pipermail/erlang-questions/2015-June/084868.html https://github.com/processone/otp/commit/dd32dd8a471b06a3d1eafe1003975a188611777f That solved all of our issues with (so far) no adverse side effects. If only I understood why... Dan Checkoway -------------- next part -------------- An HTML attachment was scrubbed... URL: From elbrujohalcon@REDACTED Tue Jun 9 22:44:14 2015 From: elbrujohalcon@REDACTED (Fernando 'Brujo' Benavides) Date: Tue, 9 Jun 2015 17:44:14 -0300 Subject: [erlang-questions] [ANN] gold_fever - a treasure hunt for erlangers Message-ID: Hi all, Last Monday we had an Erlang-Dojo at Inaka?s offices. We played a game written in Erlang that also required writing Erlang code to win (how cool is that?!). It?s a treasure hunt that starts when participants connect their own Erlang nodes to the game server node and you can play it, too! Check it out: http://github.com/inaka/gold_fever Enjoy! Fernando "Brujo" Benavides about.me/elbrujohalcon -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Tue Jun 9 22:55:14 2015 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 9 Jun 2015 22:55:14 +0200 Subject: [erlang-questions] SSL connection problem In-Reply-To: References: Message-ID: Hi! 2015-06-09 19:05 GMT+02:00 Dan Checkoway : > Hello, > > I wanted to report my findings having applied both versions of the patch. > The first thing we tried was Ingela's most recent suggestion: > > http://erlang.org/pipermail/erlang-questions/2015-June/084874.html > > That worked perfectly for APNs connections, but it had some strange side > effects in other areas of our application using SSL. > > We then tried the originally suggested patch: > > http://erlang.org/pipermail/erlang-questions/2015-June/084868.html > > https://github.com/processone/otp/commit/dd32dd8a471b06a3d1eafe1003975a188611777f > > That solved all of our issues with (so far) no adverse side effects. If > only I understood why... > > Without knowing more about your senario I can not tell you why, but I have been thiking about it and am working on a new variant of the patch that will include that logic too. I can see that those changes will be needed in other situations than in the reported one. Regards Ingela Erlang/OTP Team - Ericsson AB > Dan Checkoway > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From steven.charles.davis@REDACTED Wed Jun 10 01:55:45 2015 From: steven.charles.davis@REDACTED (Steve Davis) Date: Tue, 9 Jun 2015 18:55:45 -0500 Subject: [erlang-questions] Passing a digraph between processes on the same node Message-ID: <8944D0F4-E971-4986-9302-48794DDB9D8C@gmail.com> Hi, Somehow I?m not seeing why the following fails: -module(gtest). -export([test/0]). test() -> Test = self(), spawn(fun() -> graph(Test) end), receive {ok, G} -> digraph:vertices(G) after 5000 -> timeout end. graph(Pid) -> G = digraph:new(), digraph:add_vertex(G), Pid ! {ok, G}. ?since the backing ets table is ?protected" by default, shouldn?t the calling process be able to read the values set by the process that builds the digraph? (It?s probably trivial and me being dumb). ty for your time, /s -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Wed Jun 10 02:55:53 2015 From: vinoski@REDACTED (Steve Vinoski) Date: Tue, 9 Jun 2015 20:55:53 -0400 Subject: [erlang-questions] Passing a digraph between processes on the same node In-Reply-To: <8944D0F4-E971-4986-9302-48794DDB9D8C@gmail.com> References: <8944D0F4-E971-4986-9302-48794DDB9D8C@gmail.com> Message-ID: On Tue, Jun 9, 2015 at 7:55 PM, Steve Davis wrote: > Hi, > > Somehow I?m not seeing why the following fails: > > -module(gtest). > > -export([test/0]). > > test() -> > Test = self(), > spawn(fun() -> graph(Test) end), > receive > {ok, G} -> > digraph:vertices(G) > after 5000 -> > timeout > end. > > graph(Pid) -> > G = digraph:new(), > digraph:add_vertex(G), > Pid ! {ok, G}. > > ?since the backing ets table is ?protected" by default, shouldn?t the > calling process be able to read the values set by the process that builds > the digraph? > The process running graph/1 is the owner of the ets tables. It dies as soon as the graph/1 function completes and it takes the ets tables down with it. Add two calls to ets:i/0, one right after receiving {ok,G} and the other right after the digraph:new/0 call, then run gtest:test/0 from the shell and you'll see that the digraph-related ets tables disappear by the time the receive handles the message. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From steven.charles.davis@REDACTED Wed Jun 10 03:10:58 2015 From: steven.charles.davis@REDACTED (Steve Davis) Date: Tue, 9 Jun 2015 20:10:58 -0500 Subject: [erlang-questions] Passing a digraph between processes on the same node In-Reply-To: References: <8944D0F4-E971-4986-9302-48794DDB9D8C@gmail.com> Message-ID: <3C807FB6-BFBD-4D00-A2D8-9A34FBF50477@gmail.com> Ouch. OK, I totally see it. tysm Mr. V! > On Jun 9, 2015, at 7:55 PM, Steve Vinoski wrote: > > > On Tue, Jun 9, 2015 at 7:55 PM, Steve Davis > wrote: > Hi, > > Somehow I?m not seeing why the following fails: > > -module(gtest). > > -export([test/0]). > > test() -> > Test = self(), > spawn(fun() -> graph(Test) end), > receive > {ok, G} -> > digraph:vertices(G) > after 5000 -> > timeout > end. > > graph(Pid) -> > G = digraph:new(), > digraph:add_vertex(G), > Pid ! {ok, G}. > > ?since the backing ets table is ?protected" by default, shouldn?t the calling process be able to read the values set by the process that builds the digraph? > > The process running graph/1 is the owner of the ets tables. It dies as soon as the graph/1 function completes and it takes the ets tables down with it. > > Add two calls to ets:i/0, one right after receiving {ok,G} and the other right after the digraph:new/0 call, then run gtest:test/0 from the shell and you'll see that the digraph-related ets tables disappear by the time the receive handles the message. > > --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From dominicletz@REDACTED Thu Jun 11 03:04:54 2015 From: dominicletz@REDACTED (Dominic Letz) Date: Thu, 11 Jun 2015 09:04:54 +0800 Subject: [erlang-questions] HEART In-Reply-To: <20150523203304.GA6840@corelatus.se> References: <08E64BBA-163C-4CFD-885C-0F2FC9BAD36B@widetag.com> <555280BE.7030605@meetinghouse.net> <5552A20B.7090104@gmail.com> <20150523203304.GA6840@corelatus.se> Message-ID: Even later reply. To chime in on Danills comment. It is a linux specific problem that the kernel OOM killer will go ahead and kill the whole process tree meaning Erlang and Heart at the same time because heart is a child process of erl. For this reason I would strongly advise against using heart on linux based systems at this time. One option is using supervisord which is very easy to configure and use with erlang - and does not have the above problem. Here is a complete sample configuration with '...' as placeholders for your deployment: /etc/supervisord/conf.d/erl.conf: [program:erl] autorestart=true command=/usr/bin/erl -noinput -noshell +K true -boot ... -config ... directory=... environment=HOME=... redirect_stderr=true user=... Best On Sun, May 24, 2015 at 4:33 AM, Matthias Lang wrote: > On 13. May 2015, Michael L Martin wrote: > > > But who watches the watchdog? > > Late reply. One approach is to have a hardware watchdog. > > On the embedded system I work on, Erlang kicks a custom 'heart' > program. The heart program kicks the hardware watchdog. > > Hangs in Erlang code are dealt with by timeouts and supervisors. > Hangs in the VM are dealt with by 'heart'. > Hangs in 'heart' are dealt with by the hardware watchdog. > > This approach is sufficient to make hangs an insignificant contributor > to downtime in a five-nines environment (signalling in the SS7 > network), in my experience. > > Matt > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Dominic Letz Director of R&D Exosite -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkurkov@REDACTED Thu Jun 11 21:53:38 2015 From: mkurkov@REDACTED (Mikl Kurkov) Date: Thu, 11 Jun 2015 22:53:38 +0300 Subject: [erlang-questions] HTTP client with sessions support Message-ID: Hi! I'm looking for a HTTP client with HTTP sessions support. That means it should store and properly use session cookies and follow redirects. Options: 1. httpc - standard app, has cookies store, redirects. Main problem is that it uses heavyweight profiles to isolate sessions, So for each session I will need to create an atom (for name) and also a profile ETS table will be created. One possible workaround is to use some kind of pool of predefined httpc profiles, flushing cookies on each session start. This will not work good for long running sessions though. 2. lhttpc - it seems to be closed 3. hackney - has redirects, but no cookie store, also definitely need some work on cookie processing code - looks like it uses outdated implementation from some http _server_, so it has parser for 'cookie' header and builder for 'set-cookie'. 4. ibrowse - doesn't have session support (redirects, cookies) 5. gun - battle tested, low-level, no session support 6. xhttpc (https://github.com/seriyps/xhttpc) - not widely known, but looks promising, uses layered middleware architecture. Has already implemented middlewares for cookie store (parser based on last RFC6265), redirects, compression. Supports different backends - httpc, hackney, lhttpc. I plan to go with xhttpc, maybe implementing backend on top of gun. Any suggestions, am I missing something? -- Mikl -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkurkov@REDACTED Thu Jun 11 22:14:04 2015 From: mkurkov@REDACTED (Mikl Kurkov) Date: Thu, 11 Jun 2015 23:14:04 +0300 Subject: [erlang-questions] http_uri:encode not quoting control characters Message-ID: Hi, just figured out that http_uri:encode function doesn't percent-encode control characters, like this: ``` http_uri:encode("new\nlines\nhere"). "new\nlines\nhere" ``` RFC3986 (https://www.ietf.org/rfc/rfc3986.txt) states that: A percent-encoding mechanism is used to represent a data octet in a component when that octet's corresponding character is outside the allowed set or is being used as a delimiter of, or within, the component. Characters that are allowed in a URI but do not have a reserved purpose are called unreserved. These include uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde. unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" So it looks like control characters are not allowed in URI and should be encoded. I wonder why http_uri behaves like this, is it intentional? Erlang 17.5.3 -- Mikl -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.j.thompson@REDACTED Thu Jun 11 22:26:22 2015 From: s.j.thompson@REDACTED (Simon Thompson) Date: Thu, 11 Jun 2015 22:26:22 +0200 Subject: [erlang-questions] Lecturer position in Programming Languages / Security at Kent Message-ID: <3526EEC6-3ECA-4CF7-A281-0907BEC5466D@kent.ac.uk> We?re looking for excellent PL/security people to recruit as faculty to join us in the School of Computing at Kent. Do apply if you?re interested, or mail me if you want to find out more. Simon Simon Thompson | Professor of Logic and Computation School of Computing | University of Kent | Canterbury, CT2 7NF, UK s.j.thompson@REDACTED | M +44 7986 085754 | W www.cs.kent.ac.uk/~sjt From essen@REDACTED Fri Jun 12 00:39:15 2015 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Fri, 12 Jun 2015 00:39:15 +0200 Subject: [erlang-questions] HTTP client with sessions support In-Reply-To: References: Message-ID: <557A0E13.6010100@ninenines.eu> On 06/11/2015 09:53 PM, Mikl Kurkov wrote: > 5. gun - battle tested, low-level, no session support Right we do want to have a cookie store later on. I am not sure how this is supposed to look yet though. Suggestions welcome, I believe there is a ticket for it. Redirects, I am not too sure, it's fairly application-dependent (for example I doubt you'd want to redirect automatically every time after a successful POST to a REST API). -- Lo?c Hoguin http://ninenines.eu From bchesneau@REDACTED Fri Jun 12 04:38:16 2015 From: bchesneau@REDACTED (Benoit Chesneau) Date: Fri, 12 Jun 2015 02:38:16 +0000 Subject: [erlang-questions] HTTP client with sessions support In-Reply-To: <557A0E13.6010100@ninenines.eu> References: <557A0E13.6010100@ninenines.eu> Message-ID: Mikl what is missing in the cookie implementation of hackney? There is a new version coming next week so let's try to fix that... (any ticket is welcome). Loic, only the 303 case could work with POST, other cases are ignored in hackney. - beno?t On Fri 12 Jun 2015 at 00:39 Lo?c Hoguin wrote: > On 06/11/2015 09:53 PM, Mikl Kurkov wrote: > > 5. gun - battle tested, low-level, no session support > > Right we do want to have a cookie store later on. I am not sure how this > is supposed to look yet though. Suggestions welcome, I believe there is > a ticket for it. > > Redirects, I am not too sure, it's fairly application-dependent (for > example I doubt you'd want to redirect automatically every time after a > successful POST to a REST API). > > -- > Lo?c Hoguin > http://ninenines.eu > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.j.thompson@REDACTED Fri Jun 12 06:44:07 2015 From: s.j.thompson@REDACTED (Simon Thompson) Date: Fri, 12 Jun 2015 06:44:07 +0200 Subject: [erlang-questions] Lecturer position in Programming Languages / Security at Kent In-Reply-To: <3526EEC6-3ECA-4CF7-A281-0907BEC5466D@kent.ac.uk> References: <3526EEC6-3ECA-4CF7-A281-0907BEC5466D@kent.ac.uk> Message-ID: And here?s the link for more info :-) https://jobs.kent.ac.uk/fe/tpl_kent01.asp?s=4A515F4E5A565B1A&jobid=39293,3436347277&key=44012873&c=493414763421&pagestamp=sesdyyyrqxijqwrrmd S. > On 11 Jun 2015, at 22:26, Simon Thompson wrote: > > > We?re looking for excellent PL/security people to recruit as faculty to join us in the School of Computing at Kent. Do apply if you?re interested, or mail me if you want to find out more. > > Simon > > Simon Thompson | Professor of Logic and Computation School of Computing | University of Kent | Canterbury, CT2 7NF, UK s.j.thompson@REDACTED | M +44 7986 085754 | W www.cs.kent.ac.uk/~sjt From mkurkov@REDACTED Fri Jun 12 14:19:40 2015 From: mkurkov@REDACTED (Mikl Kurkov) Date: Fri, 12 Jun 2015 15:19:40 +0300 Subject: [erlang-questions] HTTP client with sessions support In-Reply-To: <557A0E13.6010100@ninenines.eu> References: <557A0E13.6010100@ninenines.eu> Message-ID: On Fri, Jun 12, 2015 at 1:39 AM, Lo?c Hoguin wrote: > Right we do want to have a cookie store later on. I am not sure how this > is supposed to look yet though. Suggestions welcome, I believe there is a > ticket for it. > I'm afraid it will not be easy to find solution that will fit all user cases. Someone need few huge client sessions, keeping cookies for many sites in ETS or even SQL database. It seems httpc optimized for this use case. In my case I need many tiny isolated sessions, so it is possible to have session store in state. That's why I like xhttpc approach - you get some stable API and can use different implementations for say cookie store that fits your needs. > Redirects, I am not too sure, it's fairly application-dependent (for > example I doubt you'd want to redirect automatically every time after a > successful POST to a REST API). > Regarding redirects, it of course has its caveats but it should just work for some main cases. -- Mikl -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkurkov@REDACTED Fri Jun 12 14:32:08 2015 From: mkurkov@REDACTED (Mikl Kurkov) Date: Fri, 12 Jun 2015 15:32:08 +0300 Subject: [erlang-questions] HTTP client with sessions support In-Reply-To: References: <557A0E13.6010100@ninenines.eu> Message-ID: On Fri, Jun 12, 2015 at 5:38 AM, Benoit Chesneau wrote: > Mikl what is missing in the cookie implementation of hackney? There is a > new version coming next week so let's try to fix that... (any ticket is > welcome). > Benoit, First thing I stumbled upon on second minute of hackney usage is that it silently ignored cookies with Expires attribute, I fixed this in my fork, but looking into code I understood that it was ported from some server codebase, so it uses Cookie parser to parse Set-Cookie, and Set-Cookie builder to build Cookie. They have slightly different syntax and constraints, so it need some refactoring or even full rewrite. Also it seems several different representations for cookies are used inside lib, like {Name, Value}, {Name, [{Name,Value}|Attrs]}, {Name, Value, Attrs}. It would be great to have one unified structure for them. Ticket added, see on github. Another issue that bothers me is usage of process dictionary, I always try to avoid this. -- Mikl -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Fri Jun 12 14:44:00 2015 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Fri, 12 Jun 2015 14:44:00 +0200 Subject: [erlang-questions] HTTP client with sessions support In-Reply-To: References: <557A0E13.6010100@ninenines.eu> Message-ID: <557AD410.6050202@ninenines.eu> On 06/12/2015 02:19 PM, Mikl Kurkov wrote: > On Fri, Jun 12, 2015 at 1:39 AM, Lo?c Hoguin > wrote: > > Right we do want to have a cookie store later on. I am not sure how > this is supposed to look yet though. Suggestions welcome, I believe > there is a ticket for it. > > > I'm afraid it will not be easy to find solution that will fit all user > cases. > Someone need few huge client sessions, keeping cookies for many sites in > ETS or even SQL database. > It seems httpc optimized for this use case. > In my case I need many tiny isolated sessions, so it is possible to have > session store in state. > That's why I like xhttpc approach - you get some stable API and can use > different implementations for > say cookie store that fits your needs. The way I see it is that Gun needs to keep track of cookies for the current connection *and* send cookies to the user process if any other kind of tracking is required. Feeding cookies back into the Gun process should be a function call or option away. -- Lo?c Hoguin http://ninenines.eu From roe.adrian@REDACTED Fri Jun 12 15:31:22 2015 From: roe.adrian@REDACTED (Adrian Roe) Date: Fri, 12 Jun 2015 06:31:22 -0700 (PDT) Subject: [erlang-questions] HTTP client with sessions support In-Reply-To: <557AD410.6050202@ninenines.eu> References: <557AD410.6050202@ninenines.eu> Message-ID: <1434115881375.5247f8b@Nodemailer> One of the reasons I like (and extensively use) Gun is precisely because it does NOT automatically do stuff like track cookies for you or follow redirects. ? In the past we have used a seemingly endless train of Erlang HTTP clients and been tripped up when they try to be too helpful (retrying requests under the covers etc.) ?There is plenty of room for helper libraries on top of things like gun (such as shotgun - internally we have one called spud_gun), but I?m always nervous when the low level library tries to ?help?. ?Already gun by default sends keep alive messages that break e.g. API calls to AWS (Amazon terminates the tcp connection when it notices it has inbound data that its API says should not be there). I could just about see cookie handling as falling the right side of the ?does too much for you? line, but have a strong preference that helper functionality ?is clearly separated from the underlying core. Big fan of Gun / Cowboy so absolutely no criticism intended - but you did say ?suggestions welcome?. Adrian On Friday, Jun 12, 2015 at 1:44 pm, Lo?c Hoguin , wrote: On 06/12/2015 02:19 PM, Mikl Kurkov wrote: > On Fri, Jun 12, 2015 at 1:39 AM, Lo?c Hoguin > wrote: > > Right we do want to have a cookie store later on. I am not sure how > this is supposed to look yet though. Suggestions welcome, I believe > there is a ticket for it. > > > I'm afraid it will not be easy to find solution that will fit all user > cases. > Someone need few huge client sessions, keeping cookies for many sites in > ETS or even SQL database. > It seems httpc optimized for this use case. > In my case I need many tiny isolated sessions, so it is possible to have > session store in state. > That's why I like xhttpc approach - you get some stable API and can use > different implementations for > say cookie store that fits your needs. The way I see it is that Gun needs to keep track of cookies for the current connection *and* send cookies to the user process if any other kind of tracking is required. Feeding cookies back into the Gun process should be a function call or option away. -- Lo?c Hoguin http://ninenines.eu _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Fri Jun 12 18:27:16 2015 From: bchesneau@REDACTED (Benoit Chesneau) Date: Fri, 12 Jun 2015 16:27:16 +0000 Subject: [erlang-questions] HTTP client with sessions support In-Reply-To: References: <557A0E13.6010100@ninenines.eu> Message-ID: On Fri, Jun 12, 2015 at 2:32 PM Mikl Kurkov wrote: > On Fri, Jun 12, 2015 at 5:38 AM, Benoit Chesneau > wrote: > >> Mikl what is missing in the cookie implementation of hackney? There is a >> new version coming next week so let's try to fix that... (any ticket is >> welcome). >> > > Benoit, > > First thing I stumbled upon on second minute of hackney usage is that it > silently ignored cookies with Expires attribute, > I fixed this in my fork, but looking into code I understood that it was > ported from some server codebase, > so it uses Cookie parser to parse Set-Cookie, and Set-Cookie builder to > build Cookie. They have slightly different syntax > and constraints, so it need some refactoring or even full rewrite. > Also it seems several different representations for cookies are used > inside lib, > like {Name, Value}, {Name, [{Name,Value}|Attrs]}, {Name, Value, Attrs}. > It would be great to have one unified structure for them. > Ticket added, see on github. > > Another issue that bothers me is usage of process dictionary, I always try > to avoid this. > > -- > Mikl > Thanks! It's useful. I will implement changes for the next coming version aka 2.0.0 . I am not sure yet what should be the API. It depends if I still want to support older versions or not. - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Fri Jun 12 18:30:11 2015 From: bchesneau@REDACTED (Benoit Chesneau) Date: Fri, 12 Jun 2015 16:30:11 +0000 Subject: [erlang-questions] HTTP client with sessions support In-Reply-To: <1434115881375.5247f8b@Nodemailer> References: <557AD410.6050202@ninenines.eu> <1434115881375.5247f8b@Nodemailer> Message-ID: On Fri, Jun 12, 2015 at 3:31 PM Adrian Roe wrote: > One of the reasons I like (and extensively use) Gun is precisely because > it does NOT automatically do stuff like track cookies for you or follow > redirects. > Not sure if you know it, but Hackney as well doesn't handle redirection by default. You need to set the option to do it. Anyway the approach of hackney is to propose choice in the way you can handle easily any content over HTTP collecting and implementing some common patterns but still letting you the choice to ignore them. - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From alessandro.sivieri@REDACTED Sat Jun 13 10:54:26 2015 From: alessandro.sivieri@REDACTED (Alessandro Sivieri) Date: Sat, 13 Jun 2015 10:54:26 +0200 Subject: [erlang-questions] Different behavior of the timer starting from command line or Erlang shell Message-ID: Hi all, I know this is probabily a silly question, but I really cannot understand the cause of following behavior: I have a small application* that communicates (through a TCP connection) with a data logger, and downloads data samples once per minute. To do that, the main function of the application invokes the function that performs the TCP call and gets the samples, and then it invokes timer:apply_interval with the same function as parameter (and, of course, 60 seconds). Now, if I open the Erlang shell and invoke the main function, everything goes smooth; if I start the application from the command line (-s main_module main_function), then the first sample is correctly downloaded, but no other sample is collected. After many different tries and experiments, I still have no clue why... I mean, the main function is the same! Why two different behaviors? Suggestions? I have also tried starting with boot_sasl, to get some logs, and after the first sample is collected, the log reports =PROGRESS REPORT==== 13-Jun-2015::10:49:43 === supervisor: {local,kernel_safe_sup} started: [{pid,<0.53.0>}, {name,timer_server}, {mfargs,{timer,start_link,[]}}, {restart_type,permanent}, {shutdown,1000}, {child_type,worker}] so I guess the timer server is correctly started... but my function is never invoked. * by "application" I don't mean an OTP application, I mean just three Erlang modules. -- Sivieri Alessandro alessandro.sivieri@REDACTED http://sivieri.me/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From zero.one.etc@REDACTED Sat Jun 13 16:52:29 2015 From: zero.one.etc@REDACTED (Giacomo Stelluti Scala) Date: Sat, 13 Jun 2015 16:52:29 +0200 Subject: [erlang-questions] syntax for Core Erlang Message-ID: Hi all, I'm wondering if someone wrote an editor package for Core Erlang language. First choose is Emacs, second Vim, but any info will be appreciated. Regards, Giacomo -- Giacomo Stelluti Scala *Information Technology **Consultant* * GitHub*: https://github.com/gsscoder * Twitter*: https://twitter.com/gsscoder * Blog*: http://gsscoder.github.com/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From boris.muehmer@REDACTED Sat Jun 13 17:09:37 2015 From: boris.muehmer@REDACTED (=?UTF-8?Q?Boris_M=C3=BChmer?=) Date: Sat, 13 Jun 2015 17:09:37 +0200 Subject: [erlang-questions] syntax for Core Erlang In-Reply-To: References: Message-ID: Hello Giacomo, do You think of something like "Erlang mode for Emacs" ( http://www.erlang.org/doc/man/erlang.el.html) or anything else? Regards, Boris 2015-06-13 16:52 GMT+02:00 Giacomo Stelluti Scala : > Hi all, > I'm wondering if someone wrote an editor package for Core Erlang language. > > First choose is Emacs, second Vim, but any info will be appreciated. > > Regards, > Giacomo > > -- > Giacomo Stelluti Scala > *Information Technology **Consultant* > * GitHub*: https://github.com/gsscoder > * Twitter*: https://twitter.com/gsscoder > * Blog*: http://gsscoder.github.com/ > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bengt.kleberg@REDACTED Sat Jun 13 20:47:08 2015 From: bengt.kleberg@REDACTED (Bengt Kleberg) Date: Sat, 13 Jun 2015 18:47:08 +0000 Subject: [erlang-questions] Different behavior of the timer starting from command line or Erlang shell In-Reply-To: References: Message-ID: Greetings According to the manual page for the timer module, apply-interval/4 is linked to a process When that process dies the timer dies Kill your shell and both will behave the same Bengt Sent from my iPhone On 13 Jun 2015, at 10:54, Alessandro Sivieri > wrote: Hi all, I know this is probabily a silly question, but I really cannot understand the cause of following behavior: I have a small application* that communicates (through a TCP connection) with a data logger, and downloads data samples once per minute. To do that, the main function of the application invokes the function that performs the TCP call and gets the samples, and then it invokes timer:apply_interval with the same function as parameter (and, of course, 60 seconds). Now, if I open the Erlang shell and invoke the main function, everything goes smooth; if I start the application from the command line (-s main_module main_function), then the first sample is correctly downloaded, but no other sample is collected. After many different tries and experiments, I still have no clue why... I mean, the main function is the same! Why two different behaviors? Suggestions? I have also tried starting with boot_sasl, to get some logs, and after the first sample is collected, the log reports =PROGRESS REPORT==== 13-Jun-2015::10:49:43 === supervisor: {local,kernel_safe_sup} started: [{pid,<0.53.0>}, {name,timer_server}, {mfargs,{timer,start_link,[]}}, {restart_type,permanent}, {shutdown,1000}, {child_type,worker}] so I guess the timer server is correctly started... but my function is never invoked. * by "application" I don't mean an OTP application, I mean just three Erlang modules. -- Sivieri Alessandro alessandro.sivieri@REDACTED http://sivieri.me/ _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Sat Jun 13 21:35:50 2015 From: ingela.andin@REDACTED (Ingela Andin) Date: Sat, 13 Jun 2015 21:35:50 +0200 Subject: [erlang-questions] HTTP client with sessions support In-Reply-To: References: Message-ID: Hi! 2015-06-11 21:53 GMT+02:00 Mikl Kurkov : > Hi! > > I'm looking for a HTTP client with HTTP sessions support. > That means it should store and properly use session cookies and follow > redirects. > > Options: > > 1. httpc - standard app, has cookies store, redirects. Main problem is > that it uses heavyweight profiles to isolate sessions, > So for each session I will need to create an atom (for name) and also a > profile ETS table will be created. > Creating a name for the profile is not that heavy?! The ets-table is an implementation detail not written in stone, it could use some other data structure like a dict or something. Feel free make a PR, if you make a good case it can be changed. Regards Ingela Erlang/OTP team - Ericsson AB [...] -------------- next part -------------- An HTML attachment was scrubbed... URL: From ulf@REDACTED Sat Jun 13 23:12:59 2015 From: ulf@REDACTED (Ulf Wiger) Date: Sat, 13 Jun 2015 23:12:59 +0200 Subject: [erlang-questions] HTTP client with sessions support In-Reply-To: References: Message-ID: <79973DB2-CBFF-45B5-ADB0-54054859225E@feuerlabs.com> > On 13 Jun 2015, at 21:35, Ingela Andin wrote: > > Creating a name for the profile is not that heavy?! The ets-table is an implementation detail not written in stone, it could use some other data structure like a dict or something. Feel free make a PR, if you make a good case it can be changed. Creating an ets table really isn?t a heavy operation. Consider the following program: -module(etsc). -compile(export_all). t(N) when N > 0 -> T = ets:new(t, []), ets:delete(T), t(N-1); t(_) -> ok. Eshell V5.10.4 (abort with ^G) 1> c(etsc). {ok,etsc} 2> timer:tc(etsc,t,[1000]). {2775,ok} 3> timer:tc(etsc,t,[1000]). {2612,ok} 4> timer:tc(etsc,t,[1000]). {2055,ok} 5> timer:tc(etsc,t,[1000]). {1881,ok} That is, on my old Macbook Air, it takes about a microsecond to create an ets table*. Creating an atom is also obviously cheap, but I cringe a bit when list_to_atom/1 is used in generic code - although in this particular case, I guess creating memory leaks because of it is not very likely. BR, Ulf W * Obviously, this test doesn?t accumulate ets tables. I removed the ets:delete/1 call, and things looked much worse: - Creating the first 1000 tables took ca 13 ms. - Creating 1000 tables when there were already 67K tables, took 6.2 seconds. - However, creating an ets table from another process was still pretty fast - ca 10 usec I conclude that having thousands of ets tables owned by a single process is a *bad* idea (probably not for this reason alone). Ulf Wiger, Co-founder & Developer Advocate, Feuerlabs Inc. http://feuerlabs.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mkurkov@REDACTED Mon Jun 15 12:03:40 2015 From: mkurkov@REDACTED (Mikl Kurkov) Date: Mon, 15 Jun 2015 13:03:40 +0300 Subject: [erlang-questions] HTTP client with sessions support In-Reply-To: <79973DB2-CBFF-45B5-ADB0-54054859225E@feuerlabs.com> References: <79973DB2-CBFF-45B5-ADB0-54054859225E@feuerlabs.com> Message-ID: On Sun, Jun 14, 2015 at 12:12 AM, Ulf Wiger wrote: > Creating an ets table really isn?t a heavy operation. > Agree, I'm mostly concerned about dynamic atom creation in runtime, isn't it recommended to avoid this on long running servers. It would be great to be able to run httpc like any other linked server with start_link and then use its Pid to send requests without need of named profile. Or maybe let use some safe runtime data as profile name, like ref or string. I see it is possible to run httpc in 'stand_alone' mode but this still requires atom profile name. But well, for current task it seems I can try to use profile per user, not per session, so atoms list will not expand endlessly with time. Thank you all for good points. -- Mikl -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.tanguay@REDACTED Mon Jun 15 18:25:25 2015 From: luc.tanguay@REDACTED (Tanguay, Luc (A584369)) Date: Mon, 15 Jun 2015 12:25:25 -0400 Subject: [erlang-questions] upgrade path from R14B02 to OTP 17.5 Message-ID: <462990D3EDDFE5458F928506D32D40C95E2EE8E92F@MBX05.bell.corp.bce.ca> Hi. We have a Erlang/OTP distributed system running on R14B02 Windows 2008 (32-bit). We plan to upgrade to OTP 17.5 (64-bit). The system involves one big server that distribute files to up to 40 smaller clients, three OTP applications, many TCP links between server and clients, a small mnesia database, many calls to erlang:open_port/2 to execute native Windows programs, etc. What is the safest upgrade path? Go straight to OTP 17.5 or something else. Do I have to read all READMEs from R14B03 to OTP 17.5? Thanks, Luc --- Luc Tanguay, ing./P. Eng. Bell Canada 514-786-6440 cell: 514-229-7585 -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.elsgaard@REDACTED Mon Jun 15 19:07:11 2015 From: thomas.elsgaard@REDACTED (Thomas Elsgaard) Date: Mon, 15 Jun 2015 17:07:11 +0000 Subject: [erlang-questions] Store / use JSON structure in an nice way ? Message-ID: Hi list I am using hackney as http client (due to PATCH support), and i have an JSON structure in the Payload, this works very well, but it is not feeling really "good" to have the JSON structure in the code, and i will also need to have some variables in the JSON structure instead of only hardcoded values. What is the correct erlangish way to handle the JSON payload, is it really to have in the code as i have it now, or can it be placed in an record ? Here is the code: Method = patch, URL = <<"http://2.2.2.2:8081/servers/localhost/zones/xxx.gl">>, Headers = [{<<"X-API-Key">>, <<"xxxxxxxx">>}], Payload = <<"{\"rrsets\":[{\"name\": \"xxx.gl\",\"type\": \"A\",\"changetype\": \"REPLACE\",\"records\": [{\"content\": \"1.1.1.1\",\"disabled\":false,\"name\": \"xxx.gl\",\"ttl\": \"3600\",\"type\": \"A\",\"priority\": \"0\"}]}]}">>, Options = [], {ok, StatusCode, RespHeaders, ClientRef} = hackney:request(Method, URL, Headers, Payload, Options). Any hints so that it looks nice ;-) Thomas -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Mon Jun 15 19:16:34 2015 From: mononcqc@REDACTED (Fred Hebert) Date: Mon, 15 Jun 2015 13:16:34 -0400 Subject: [erlang-questions] upgrade path from R14B02 to OTP 17.5 In-Reply-To: <462990D3EDDFE5458F928506D32D40C95E2EE8E92F@MBX05.bell.corp.bce.ca> References: <462990D3EDDFE5458F928506D32D40C95E2EE8E92F@MBX05.bell.corp.bce.ca> Message-ID: <20150615171632.GB32126@ferdair.local> On 06/15, Tanguay, Luc (A584369) wrote: >We have a Erlang/OTP distributed system running on R14B02 Windows 2008 >(32-bit). We plan to upgrade to OTP 17.5 (64-bit). The system >involves one big server that distribute files to up to 40 smaller >clients, three OTP applications, many TCP links between server and >clients, a small mnesia database, many calls to erlang:open_port/2 to >execute native Windows programs, etc. > >What is the safest upgrade path? Go straight to OTP 17.5 or something >else. Do I have to read all READMEs from R14B03 to OTP 17.5? > Hi Luc, there's a few interesting things to consider when going for such a plan. The idea of going through a single big jump or many smaller ones will depend on a few things: - Do you have a single big server? If so, what's the failover/takeover story for this one? what are the requirements for uptime? - Do you make use of OTP releases, or is it more of an ad-hoc deployment system? How do you go about it? - Do you have proper testing/staging servers to try things on? - Do you have Erlang engineers on hand to handle this, or are you in the (sadly somewhat common) situation where nobody knows the language, but you still have to upgrade things? Upgrading code itself can be done easily from small to larger versions by testing it locally and reading the READMEs for incompatible changes. All in all, though, hot code loading works on Erlang code and NIFs, but doesn't work on the VM itself. While you can move from small release to small release (and also reload most standard libraries without much of a problem with relups and whatnot), the VM itself will need to go down and back up to upgrade the runtime system. The safest upgrade path would be to be able to boot a second well-tested VM on a new code version on the side, and progressively move out responsibilities to this one until the old one is dead. The most brutal way to do it would just be to shut down the old node and boot the new one after. Everything else is likely going to be a gradient in between those, in my experience. Regards, Fred. From bchesneau@REDACTED Mon Jun 15 19:27:35 2015 From: bchesneau@REDACTED (Benoit Chesneau) Date: Mon, 15 Jun 2015 17:27:35 +0000 Subject: [erlang-questions] Store / use JSON structure in an nice way ? In-Reply-To: References: Message-ID: On Mon, Jun 15, 2015 at 7:07 PM Thomas Elsgaard wrote: > Hi list > > I am using hackney as http client (due to PATCH support), and i have an > JSON structure in the Payload, this works very well, but it is not feeling > really "good" to have the JSON structure in the code, and i will also need > to have some variables in the JSON structure instead of only hardcoded > values. What is the correct erlangish way to handle the JSON payload, is it > really to have in the code as i have it now, or can it be placed in an > record ? > > Here is the code: > > Method = patch, > URL = <<"http://2.2.2.2:8081/servers/localhost/zones/xxx.gl">>, > Headers = [{<<"X-API-Key">>, <<"xxxxxxxx">>}], > Payload = <<"{\"rrsets\":[{\"name\": \"xxx.gl\",\"type\": > \"A\",\"changetype\": \"REPLACE\",\"records\": [{\"content\": > \"1.1.1.1\",\"disabled\":false,\"name\": \"xxx.gl\",\"ttl\": > \"3600\",\"type\": \"A\",\"priority\": \"0\"}]}]}">>, > Options = [], > {ok, StatusCode, RespHeaders, ClientRef} = hackney:request(Method, URL, > Headers, Payload, Options). > > Any hints so that it looks nice ;-) > > Not sure to fully understand the question but as of today I would use a map to keep a JSON. Either JSX or Jiffy allow that today. - benoit > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nx@REDACTED Mon Jun 15 19:55:11 2015 From: nx@REDACTED (nx) Date: Mon, 15 Jun 2015 17:55:11 +0000 Subject: [erlang-questions] Store / use JSON structure in an nice way ? In-Reply-To: References: Message-ID: Use a library for converting Erlang terms to JSON. Jiffy: https://github.com/davisp/jiffy JSX: https://github.com/talentdeficit/jsx For JSX, you could do the following: Payload = [{<<"rrsets">>, [{<<"name">>, <<"xxx.gl">>}, {<<"type">>, <<"A">>}, {<<"changetype">>, <<"REPLACE">>}, {<<"records">>, [{<<"content">>, <<"2.1.1.1">>}, {<<"disabled">>, false}, {<<"name">>, <<" xxx.gl">>}, {<<"ttl">>, <<"3600">>}, {<<"type">>, <<"A">>}, {<<"priority">>, <<"0">>}]}]}], Options = [], Json = jsx:encode(Payload), {ok, StatusCode, RespHeaders, ClientRef = hackney:request(Method, URL, Headers, Json, Options). Side-note: maybe you could make a PR to erlcloud ( https://github.com/gleber/erlcloud) to get Route53 support in? :) -------------- next part -------------- An HTML attachment was scrubbed... URL: From thomas.elsgaard@REDACTED Mon Jun 15 20:33:46 2015 From: thomas.elsgaard@REDACTED (Thomas Elsgaard) Date: Mon, 15 Jun 2015 18:33:46 +0000 Subject: [erlang-questions] Store / use JSON structure in an nice way ? In-Reply-To: References: Message-ID: Thanks to all, i will look at it tonight! nx: not an bad idea, but this is for the powerdns api (might be that powerdns is also used for route53) I need to look closer to erlcloud, it sounds interestingly Thomas man. 15. jun. 2015 kl. 19.55 skrev nx : > Use a library for converting Erlang terms to JSON. > > Jiffy: https://github.com/davisp/jiffy > JSX: https://github.com/talentdeficit/jsx > > For JSX, you could do the following: > > Payload = [{<<"rrsets">>, [{<<"name">>, <<"xxx.gl">>}, {<<"type">>, > <<"A">>}, {<<"changetype">>, <<"REPLACE">>}, {<<"records">>, > [{<<"content">>, <<"2.1.1.1">>}, {<<"disabled">>, false}, {<<"name">>, <<" > xxx.gl">>}, {<<"ttl">>, <<"3600">>}, {<<"type">>, <<"A">>}, > {<<"priority">>, <<"0">>}]}]}], > Options = [], > > Json = jsx:encode(Payload), > > {ok, StatusCode, RespHeaders, ClientRef = hackney:request(Method, URL, > Headers, Json, Options). > > Side-note: maybe you could make a PR to erlcloud ( > https://github.com/gleber/erlcloud) to get Route53 support in? :) > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luc.tanguay@REDACTED Mon Jun 15 20:10:01 2015 From: luc.tanguay@REDACTED (Tanguay, Luc (A584369)) Date: Mon, 15 Jun 2015 14:10:01 -0400 Subject: [erlang-questions] upgrade path from R14B02 to OTP 17.5 In-Reply-To: <20150615171632.GB32126@ferdair.local> References: <462990D3EDDFE5458F928506D32D40C95E2EE8E92F@MBX05.bell.corp.bce.ca> <20150615171632.GB32126@ferdair.local> Message-ID: <462990D3EDDFE5458F928506D32D40C95E2EE8E9E5@MBX05.bell.corp.bce.ca> Merci Fred. Erlang engineer? That must be me. I developed the whole system, and still supports it. I use OTP releases (and rebar) and Common Test to perform basic testing. The source code and documentation is kept in a Git repository. We have 2 servers (primary and secondary/standby). I also have a spare server in my lab that I intent to use for this major upgrade (server and clients development and testing). In the lab I have VMWare. I can create snapshot before major changes and revert back easily if something goes wrong. The system does not run 24/7. We have a maintenance window that allow us to perfrom upgrades (servers and/or clients) when no users are in the system. I'll begin my upgrade effort by reading the READMEs. Regards, Luc --- Luc Tanguay, ing./P. Eng. Bell Canada 514-786-6440 cell: 514-229-7585 -----Original Message----- From: Fred Hebert [mailto:mononcqc@REDACTED] Sent: June-15-15 13:17 To: Tanguay, Luc (A584369) Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] upgrade path from R14B02 to OTP 17.5 On 06/15, Tanguay, Luc (A584369) wrote: >We have a Erlang/OTP distributed system running on R14B02 Windows 2008 >(32-bit). We plan to upgrade to OTP 17.5 (64-bit). The system >involves one big server that distribute files to up to 40 smaller >clients, three OTP applications, many TCP links between server and >clients, a small mnesia database, many calls to erlang:open_port/2 to >execute native Windows programs, etc. > >What is the safest upgrade path? Go straight to OTP 17.5 or something >else. Do I have to read all READMEs from R14B03 to OTP 17.5? > Hi Luc, there's a few interesting things to consider when going for such a plan. The idea of going through a single big jump or many smaller ones will depend on a few things: - Do you have a single big server? If so, what's the failover/takeover story for this one? what are the requirements for uptime? - Do you make use of OTP releases, or is it more of an ad-hoc deployment system? How do you go about it? - Do you have proper testing/staging servers to try things on? - Do you have Erlang engineers on hand to handle this, or are you in the (sadly somewhat common) situation where nobody knows the language, but you still have to upgrade things? Upgrading code itself can be done easily from small to larger versions by testing it locally and reading the READMEs for incompatible changes. All in all, though, hot code loading works on Erlang code and NIFs, but doesn't work on the VM itself. While you can move from small release to small release (and also reload most standard libraries without much of a problem with relups and whatnot), the VM itself will need to go down and back up to upgrade the runtime system. The safest upgrade path would be to be able to boot a second well-tested VM on a new code version on the side, and progressively move out responsibilities to this one until the old one is dead. The most brutal way to do it would just be to shut down the old node and boot the new one after. Everything else is likely going to be a gradient in between those, in my experience. Regards, Fred. From g@REDACTED Tue Jun 16 10:56:17 2015 From: g@REDACTED (Garrett Smith) Date: Tue, 16 Jun 2015 10:56:17 +0200 Subject: [erlang-questions] upgrade path from R14B02 to OTP 17.5 In-Reply-To: <462990D3EDDFE5458F928506D32D40C95E2EE8E92F@MBX05.bell.corp.bce.ca> References: <462990D3EDDFE5458F928506D32D40C95E2EE8E92F@MBX05.bell.corp.bce.ca> Message-ID: Hi Luc, I'd like to point out that today I am top posting, because some topics should never die. I would strongly suggest that you follow Fred's advice and setup a second production server - not necessarily a separate machine/VM, but a separate version of your app, in production. Then route a controlled percentage of traffic to the new server and gradually increase that over time as your confidence soars! I honestly can't see this going well for you if you don't, short of great luck or moments of sheer terror as things mysteriously break and you scramble to revert to the old platform. Don't assume that reverting will go smoothly - many famous outages occurred when a backup procedure failed. I personally would just refuse to make such a large change in production without a real mitigation strategy. This is a fancier version of blue/green where you run two independent services in parallel and gradually shift traffic/load to another server, or back, as you carefully watch error rates. This could require some application code change, or simply the addition of a simple-as-possible router that lives in the app that directs requests to one of the available back end apps. You should also invest in some metrics - in particular error counts and user-facing latencies (e.g. response times). Again, you can run these on a single machine. The point here isn't availability, but risk mitigation of large changes. Of course you can distribute these apps on multiple servers if you want, but I wouldn't jump into that before you see the rolling release process working smoothly on your own machine with two Erlang VMs running locally. You might get some push back from authority figures that this approach is overkill - just "do it and get it over with - sure it's painful, but this will buy us another six years!" That's an argument, for sure, but consider the ongoing benefits of having a 100% safe outlet for future changes - refactoring, features, version revs, A/B testing etc. This app running on Windows would become a model for others to follow! This sounds really great to me - I would take the time you've budgeted for reading README and work on this :) Garrett On Mon, Jun 15, 2015 at 6:25 PM, Tanguay, Luc (A584369) wrote: > Hi. > > > > We have a Erlang/OTP distributed system running on R14B02 Windows 2008 > (32-bit). We plan to upgrade to OTP 17.5 (64-bit). The system involves > one big server that distribute files to up to 40 smaller clients, three OTP > applications, many TCP links between server and clients, a small mnesia > database, many calls to erlang:open_port/2 to execute native Windows > programs, etc. > > > > What is the safest upgrade path? Go straight to OTP 17.5 or something else. > Do I have to read all READMEs from R14B03 to OTP 17.5? > > > > Thanks, > > Luc > > > > --- > > Luc Tanguay, ing./P. Eng. > Bell Canada > 514-786-6440 > cell: 514-229-7585 > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From bchesneau@REDACTED Tue Jun 16 11:12:31 2015 From: bchesneau@REDACTED (Benoit Chesneau) Date: Tue, 16 Jun 2015 09:12:31 +0000 Subject: [erlang-questions] Erlang meetup in Paris In-Reply-To: References: Message-ID: Date has been switched to the Monday 29 June at 6:30 PM in the office of Xebia: http://www.meetup.com/Erlang-Paris/events/222956412/ CFP are still welcome :) Hope to see you there! - beno?t On Thu, Jun 4, 2015 at 10:03 AM Benoit Chesneau wrote: > We are organising a french meetup about "Erlang and it's ecosystem" on > 06-23 in Paris : > > http://www.meetup.com/Erlang-Paris/events/222956412/ > > The location is still to define. If you want to talk about your usage of > Erlang, Elixir or LFE, the CFP is there: > > http://goo.gl/forms/fgiU1uqZFE > > Looking forward to see you there :) > > - beno?t > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vychodil.hynek@REDACTED Tue Jun 16 11:40:34 2015 From: vychodil.hynek@REDACTED (Hynek Vychodil) Date: Tue, 16 Jun 2015 11:40:34 +0200 Subject: [erlang-questions] Store / use JSON structure in an nice way ? In-Reply-To: References: Message-ID: I think you are looking for this nice parse transform: https://github.com/bossek/embjson On Mon, Jun 15, 2015 at 7:07 PM, Thomas Elsgaard wrote: > Hi list > > I am using hackney as http client (due to PATCH support), and i have an > JSON structure in the Payload, this works very well, but it is not feeling > really "good" to have the JSON structure in the code, and i will also need > to have some variables in the JSON structure instead of only hardcoded > values. What is the correct erlangish way to handle the JSON payload, is it > really to have in the code as i have it now, or can it be placed in an > record ? > > Here is the code: > > Method = patch, > URL = <<"http://2.2.2.2:8081/servers/localhost/zones/xxx.gl">>, > Headers = [{<<"X-API-Key">>, <<"xxxxxxxx">>}], > Payload = <<"{\"rrsets\":[{\"name\": \"xxx.gl\",\"type\": > \"A\",\"changetype\": \"REPLACE\",\"records\": [{\"content\": > \"1.1.1.1\",\"disabled\":false,\"name\": \"xxx.gl\",\"ttl\": > \"3600\",\"type\": \"A\",\"priority\": \"0\"}]}]}">>, > Options = [], > {ok, StatusCode, RespHeaders, ClientRef} = hackney:request(Method, URL, > Headers, Payload, Options). > > Any hints so that it looks nice ;-) > > Thomas > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From steven.proctor@REDACTED Tue Jun 16 17:19:16 2015 From: steven.proctor@REDACTED (Steven Proctor) Date: Tue, 16 Jun 2015 10:19:16 -0500 Subject: [erlang-questions] Erlang on a Raspberry Pi for DFW Erlang User Group Message-ID: Hey all, I am going to be showing off Erlang (Elixir and LFE as well) running on a Raspberry Pi at our next DFW Erlang User Group ( http://www.meetup.com/DFW-Erlang-User-Group/events/222986865/). My question for everyone here is if you have seen or played with any good projects that make an impressive demo for what the Erlang VM can do on a Raspberry Pi. Part of the goal is to show how lightweight processes are on the Erlang VM; I have heard mention of ~1 Million processes on a Pi, and was hoping to show something somewhat mind blowing to people who haven't seen it on a Pi, or just getting into Erlang. I have some basic ideas of some simple stuff to show off, but I would love to hear what you have done with Erlang and a Raspberry Pi. Thanks! --Proctor -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony.m.esposito@REDACTED Tue Jun 16 17:45:05 2015 From: tony.m.esposito@REDACTED (Anthony Esposito) Date: Tue, 16 Jun 2015 15:45:05 +0000 Subject: [erlang-questions] Erlang on a Raspberry Pi for DFW Erlang User Group In-Reply-To: References: Message-ID: Hi Steven, This is a great idea! Let me know how much interest this gets in your group as I may need to steal :) The obvious thing that springs to mind is what ESL did here: https://twitter.com/joeerl/status/609251466835021824 and presented at EUC. Six of the nodes are running RIAK and two running plain Erlang nodes. Then they were able to demo Wombat and present amazing information on nodes in the cluster. Or rather, present it amazingly well! I like this setup because it puts across the distributed nature of the application and provides a visual representation of the individual nodes. It's much cleaner than a room full of PCs and more appealing than VMs. I think whatever you do with this it needs to interact with something rather physical to be more impressionable and bring more attention to Erlang. Despite how simple the programming might be for you it shows really well. -tony On Tue, Jun 16, 2015 at 10:19 AM Steven Proctor wrote: > Hey all, > > I am going to be showing off Erlang (Elixir and LFE as well) running on a > Raspberry Pi at our next DFW Erlang User Group ( > http://www.meetup.com/DFW-Erlang-User-Group/events/222986865/). > > My question for everyone here is if you have seen or played with any good > projects that make an impressive demo for what the Erlang VM can do on a > Raspberry Pi. > > Part of the goal is to show how lightweight processes are on the Erlang > VM; I have heard mention of ~1 Million processes on a Pi, and was hoping to > show something somewhat mind blowing to people who haven't seen it on a Pi, > or just getting into Erlang. > > I have some basic ideas of some simple stuff to show off, but I would love > to hear what you have done with Erlang and a Raspberry Pi. > > Thanks! > --Proctor > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- ======================================== Anthony Esposito github/twitter: tesp0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Tue Jun 16 18:30:25 2015 From: mjtruog@REDACTED (Michael Truog) Date: Tue, 16 Jun 2015 09:30:25 -0700 Subject: [erlang-questions] Erlang on a Raspberry Pi for DFW Erlang User Group In-Reply-To: References: Message-ID: <55804F21.4080009@gmail.com> On 06/16/2015 08:19 AM, Steven Proctor wrote: > Hey all, > > I am going to be showing off Erlang (Elixir and LFE as well) running on a Raspberry Pi at our next DFW Erlang User Group (http://www.meetup.com/DFW-Erlang-User-Group/events/222986865/). > > My question for everyone here is if you have seen or played with any good projects that make an impressive demo for what the Erlang VM can do on a Raspberry Pi. > > Part of the goal is to show how lightweight processes are on the Erlang VM; I have heard mention of ~1 Million processes on a Pi, and was hoping to show something somewhat mind blowing to people who haven't seen it on a Pi, or just getting into Erlang. > > I have some basic ideas of some simple stuff to show off, but I would love to hear what you have done with Erlang and a Raspberry Pi. Instead of the Raspberry Pi, I got 4 Odroid-C1s because they cost the same as the Raspberry Pi but have better specifications (http://www.cnx-software.com/2015/02/02/raspberry-pi-2-odroid-c1-development-boards-comparison/). I also got a LCD (16x2 characters) for each of the Odroid-C1s and had CloudI 1.5.0 (http://cloudi.org) running on all 4 (8gb microSD card with Ubuntu 14.04). I then used a C CloudI service to work with the LCD display and a Python CloudI service to handle UTF8-art fish where each fish is a CloudI service request (dieing with the timeout, swimming between the nodes while displaying the node index where it was born). I presented this demo at LinuxFest Northwest 2015 and everyone seemed to enjoy it. The repositories for the the two CloudI services are https://github.com/okeuday/odroid_display and https://github.com/okeuday/odroid_fish . You may notice that odroid_display depends on https://github.com/hardkernel/wiringPi which is a fork of a Raspberry Pi repository. The odroid_display repository also has utf8 to hd44780u conversion for the LCD display, though it doesn't yet support the Japanese in A00 or the European characters in A01, in case you are interested. If you want to see a clip of the fish in action, there is an animated gif at https://github.com/okeuday/odroid_fish#example . Best Regards, Michael > > Thanks! > --Proctor > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From rdm@REDACTED Tue Jun 16 18:40:38 2015 From: rdm@REDACTED (Rich Morin) Date: Tue, 16 Jun 2015 09:40:38 -0700 Subject: [erlang-questions] =?iso-8859-1?q?Elixir/Erlang/Phoen=ADix_OTP_Bo?= =?iso-8859-1?q?otcamp_in_Mountain_View=2C_CA=2C_9/22-23?= Message-ID: Some folks here might be interested in this event: Hackers/Founders is pleased to welcome Norberto Ortigoza for a 2-day bootcamp on Elixir, Erlang, Phoenix and OTP so you can go on to create awesomeness. H/F - Elixir/Erlang/Phoen?ix OTP Bootcamp (TWO DAYS!) http://www.meetup.com/Hackers-and-Founders/events/223275643/ -r -- http://www.cfcl.com/rdm Rich Morin rdm@REDACTED http://www.cfcl.com/rdm/resume San Bruno, CA, USA +1 650-873-7841 Software system design, development, and documentation From luc.tanguay@REDACTED Tue Jun 16 21:27:48 2015 From: luc.tanguay@REDACTED (Tanguay, Luc (A584369)) Date: Tue, 16 Jun 2015 15:27:48 -0400 Subject: [erlang-questions] upgrade path from R14B02 to OTP 17.5 In-Reply-To: References: <462990D3EDDFE5458F928506D32D40C95E2EE8E92F@MBX05.bell.corp.bce.ca> Message-ID: <462990D3EDDFE5458F928506D32D40C95E2EE8EF0F@MBX05.bell.corp.bce.ca> Thanks Garrett. With the number of client nodes involved, I will have to test with 2 Erlang installation on one machine (server or client). I think this is easy to do with Erlang/OTP: the only system-wise settings that I know of is the PATH environment variable. Am I right? The current system generates 2174 files every night, for a total size of 21.8 GB, and distributes them to 19 client systems (at one point we had 36 clients). A complete cycle runs for 5 hours. It will be difficult to produce this load in parallel while testing the new system. But there are already some hooks in the Erlang application that were put in place when I first developed it (for ex. distribute the files and as soon as the client has received and validated the file, delete it to preserve precious disk space on client, or, send a file that triggers a TCP timeout or TCP transmission error). Bottom line: plan, test, test and re-test. And test the rollback procedure... Luc --- Luc Tanguay, ing./P. Eng. Bell Canada 514-786-6440 cell: 514-229-7585 -----Original Message----- From: Garrett Smith [mailto:g@REDACTED] Sent: June-16-15 04:56 To: Tanguay, Luc (A584369) Cc: erlang-questions@REDACTED Subject: Re: [erlang-questions] upgrade path from R14B02 to OTP 17.5 Hi Luc, I'd like to point out that today I am top posting, because some topics should never die. I would strongly suggest that you follow Fred's advice and setup a second production server - not necessarily a separate machine/VM, but a separate version of your app, in production. Then route a controlled percentage of traffic to the new server and gradually increase that over time as your confidence soars! I honestly can't see this going well for you if you don't, short of great luck or moments of sheer terror as things mysteriously break and you scramble to revert to the old platform. Don't assume that reverting will go smoothly - many famous outages occurred when a backup procedure failed. I personally would just refuse to make such a large change in production without a real mitigation strategy. This is a fancier version of blue/green where you run two independent services in parallel and gradually shift traffic/load to another server, or back, as you carefully watch error rates. This could require some application code change, or simply the addition of a simple-as-possible router that lives in the app that directs requests to one of the available back end apps. You should also invest in some metrics - in particular error counts and user-facing latencies (e.g. response times). Again, you can run these on a single machine. The point here isn't availability, but risk mitigation of large changes. Of course you can distribute these apps on multiple servers if you want, but I wouldn't jump into that before you see the rolling release process working smoothly on your own machine with two Erlang VMs running locally. You might get some push back from authority figures that this approach is overkill - just "do it and get it over with - sure it's painful, but this will buy us another six years!" That's an argument, for sure, but consider the ongoing benefits of having a 100% safe outlet for future changes - refactoring, features, version revs, A/B testing etc. This app running on Windows would become a model for others to follow! This sounds really great to me - I would take the time you've budgeted for reading README and work on this :) Garrett On Mon, Jun 15, 2015 at 6:25 PM, Tanguay, Luc (A584369) wrote: > Hi. > > > > We have a Erlang/OTP distributed system running on R14B02 Windows 2008 > (32-bit). We plan to upgrade to OTP 17.5 (64-bit). The system involves > one big server that distribute files to up to 40 smaller clients, > three OTP applications, many TCP links between server and clients, a > small mnesia database, many calls to erlang:open_port/2 to execute > native Windows programs, etc. > > > > What is the safest upgrade path? Go straight to OTP 17.5 or something else. > Do I have to read all READMEs from R14B03 to OTP 17.5? > > > > Thanks, > > Luc > > > > --- > > Luc Tanguay, ing./P. Eng. > Bell Canada > 514-786-6440 > cell: 514-229-7585 > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From g@REDACTED Tue Jun 16 23:01:20 2015 From: g@REDACTED (Garrett Smith) Date: Tue, 16 Jun 2015 23:01:20 +0200 Subject: [erlang-questions] upgrade path from R14B02 to OTP 17.5 In-Reply-To: <462990D3EDDFE5458F928506D32D40C95E2EE8EF0F@MBX05.bell.corp.bce.ca> References: <462990D3EDDFE5458F928506D32D40C95E2EE8E92F@MBX05.bell.corp.bce.ca> <462990D3EDDFE5458F928506D32D40C95E2EE8EF0F@MBX05.bell.corp.bce.ca> Message-ID: How will you know if the modified system is producing the correct output? Why not simply run the second system in parallel for a few nights, comparing its output to the production system once the batch has completed? Sorry, yeah - a batch process doesn't really require a router - I was assuming the wrong type of application there. As for system wide configuration, IIRC this depends on how you're running your Windows processes - but each process should have its own environment settings. To run separate Erlang distributions concurrently you'd just use ERL_LIBS to point to your top level directory - each process getting a different value. Those who are release gurus might shout at me and have a better approach, but this is certainly one way to run separate lines of code per Erlang VM. On Tue, Jun 16, 2015 at 9:27 PM, Tanguay, Luc (A584369) wrote: > Thanks Garrett. > > With the number of client nodes involved, I will have to test with 2 Erlang installation on one machine (server or client). I think this is easy to do with Erlang/OTP: the only system-wise settings that I know of is the PATH environment variable. Am I right? > > The current system generates 2174 files every night, for a total size of 21.8 GB, and distributes them to 19 client systems (at one point we had 36 clients). A complete cycle runs for 5 hours. It will be difficult to produce this load in parallel while testing the new system. But there are already some hooks in the Erlang application that were put in place when I first developed it (for ex. distribute the files and as soon as the client has received and validated the file, delete it to preserve precious disk space on client, or, send a file that triggers a TCP timeout or TCP transmission error). > > Bottom line: plan, test, test and re-test. And test the rollback procedure... > > Luc > > --- > Luc Tanguay, ing./P. Eng. > Bell Canada > 514-786-6440 > cell: 514-229-7585 > > > -----Original Message----- > From: Garrett Smith [mailto:g@REDACTED] > Sent: June-16-15 04:56 > To: Tanguay, Luc (A584369) > Cc: erlang-questions@REDACTED > Subject: Re: [erlang-questions] upgrade path from R14B02 to OTP 17.5 > > Hi Luc, > > I'd like to point out that today I am top posting, because some topics should never die. > > I would strongly suggest that you follow Fred's advice and setup a second production server - not necessarily a separate machine/VM, but a separate version of your app, in production. Then route a controlled percentage of traffic to the new server and gradually increase that over time as your confidence soars! > > I honestly can't see this going well for you if you don't, short of great luck or moments of sheer terror as things mysteriously break and you scramble to revert to the old platform. Don't assume that reverting will go smoothly - many famous outages occurred when a backup procedure failed. I personally would just refuse to make such a large change in production without a real mitigation strategy. > > This is a fancier version of blue/green where you run two independent services in parallel and gradually shift traffic/load to another server, or back, as you carefully watch error rates. > > This could require some application code change, or simply the addition of a simple-as-possible router that lives in the app that directs requests to one of the available back end apps. You should also invest in some metrics - in particular error counts and user-facing latencies (e.g. response times). > > Again, you can run these on a single machine. The point here isn't availability, but risk mitigation of large changes. Of course you can distribute these apps on multiple servers if you want, but I wouldn't jump into that before you see the rolling release process working smoothly on your own machine with two Erlang VMs running locally. > > You might get some push back from authority figures that this approach is overkill - just "do it and get it over with - sure it's painful, but this will buy us another six years!" > > That's an argument, for sure, but consider the ongoing benefits of having a 100% safe outlet for future changes - refactoring, features, version revs, A/B testing etc. This app running on Windows would become a model for others to follow! > > This sounds really great to me - I would take the time you've budgeted for reading README and work on this :) > > Garrett > > On Mon, Jun 15, 2015 at 6:25 PM, Tanguay, Luc (A584369) wrote: >> Hi. >> >> >> >> We have a Erlang/OTP distributed system running on R14B02 Windows 2008 >> (32-bit). We plan to upgrade to OTP 17.5 (64-bit). The system involves >> one big server that distribute files to up to 40 smaller clients, >> three OTP applications, many TCP links between server and clients, a >> small mnesia database, many calls to erlang:open_port/2 to execute >> native Windows programs, etc. >> >> >> >> What is the safest upgrade path? Go straight to OTP 17.5 or something else. >> Do I have to read all READMEs from R14B03 to OTP 17.5? >> >> >> >> Thanks, >> >> Luc >> >> >> >> --- >> >> Luc Tanguay, ing./P. Eng. >> Bell Canada >> 514-786-6440 >> cell: 514-229-7585 >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> From erlang@REDACTED Wed Jun 17 11:02:37 2015 From: erlang@REDACTED (Joe Armstrong) Date: Wed, 17 Jun 2015 11:02:37 +0200 Subject: [erlang-questions] grammar of Xref query expressions Message-ID: Hi, Does anybody know where the grammar and semantics of Xref query expressions are defined? I am referring to section 6.3 of the xref manual page at http://www.erlang.org/doc/apps/tools/xref_chapter.html#id65989 Cheers /Joe From elbrujohalcon@REDACTED Wed Jun 17 13:43:59 2015 From: elbrujohalcon@REDACTED (Fernando 'Brujo' Benavides) Date: Wed, 17 Jun 2015 08:43:59 -0300 Subject: [erlang-questions] grammar of Xref query expressions In-Reply-To: References: Message-ID: I think it?s here: https://github.com/erlang/otp/blob/maint/lib/tools/src/xref_parser.yrl Fernando "Brujo" Benavides about.me/elbrujohalcon > On Jun 17, 2015, at 06:02, Joe Armstrong wrote: > > Hi, > > Does anybody know where the grammar and semantics of Xref query > expressions are defined? > > I am referring to section 6.3 of the xref manual page at > > http://www.erlang.org/doc/apps/tools/xref_chapter.html#id65989 > > Cheers > > /Joe > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From carlsson.richard@REDACTED Wed Jun 17 14:48:15 2015 From: carlsson.richard@REDACTED (Richard Carlsson) Date: Wed, 17 Jun 2015 14:48:15 +0200 Subject: [erlang-questions] grammar of Xref query expressions In-Reply-To: References: Message-ID: Try the link to the reference manual section, from the top of the page. /Richard On Wed, Jun 17, 2015 at 11:02 AM, Joe Armstrong wrote: > Hi, > > Does anybody know where the grammar and semantics of Xref query > expressions are defined? > > I am referring to section 6.3 of the xref manual page at > > http://www.erlang.org/doc/apps/tools/xref_chapter.html#id65989 > > Cheers > > /Joe > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ddosia@REDACTED Wed Jun 17 15:53:49 2015 From: ddosia@REDACTED (Daniil Churikov) Date: Wed, 17 Jun 2015 14:53:49 +0100 Subject: [erlang-questions] Looking for advice on simultaneous data modification Message-ID: Hello dear list. I am looking for advice to, perhaps, very common problem. I have database which does not support transactions, only CAS operations for single record. I have one-to-many relationship between 2 tables, and I need to implement cascade deletion of dependent records from table_2 when main record from table_1 was deleted. All the operations may happen in different processes simultaneously. So my intention is to do some kind of a mutex, which incorporate following properties: * when main record is in deletion-state, every other action on main and/or dependent record should wait until it will be deleted; * if main record is in normal-state, all dependencies may be modified without any strict order. Is there any library in the wild which allow me to do this kind of mutex? Maybe I have chosen wrong approach? Any suggestions? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergej.jurecko@REDACTED Wed Jun 17 16:00:59 2015 From: sergej.jurecko@REDACTED (Sergej Jurecko) Date: Wed, 17 Jun 2015 16:00:59 +0200 Subject: [erlang-questions] Looking for advice on simultaneous data modification In-Reply-To: References: Message-ID: Spawn a process to execute delete, use register/2 as a kind of mutex, anyone waiting for delete to finish should attach to it with monitor/2. case catch register(lock,self()) of true -> Havelock; {?EXIT?,_} -> erlang:monitor(process,lock), ?.wait for finish end, Or use a proper database? Can you share with us why you?re not using one? Sergej From: on behalf of Daniil Churikov Date: Wednesday 17 June 2015 15:53 To: Subject: [erlang-questions] Looking for advice on simultaneous data modification Hello dear list. I am looking for advice to, perhaps, very common problem. I have database which does not support transactions, only CAS operations for single record. I have one-to-many relationship between 2 tables, and I need to implement cascade deletion of dependent records from table_2 when main record from table_1 was deleted. All the operations may happen in different processes simultaneously. So my intention is to do some kind of a mutex, which incorporate following properties: * when main record is in deletion-state, every other action on main and/or dependent record should wait until it will be deleted; * if main record is in normal-state, all dependencies may be modified without any strict order. Is there any library in the wild which allow me to do this kind of mutex? Maybe I have chosen wrong approach? Any suggestions? Thanks! _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From rtrlists@REDACTED Wed Jun 17 16:03:37 2015 From: rtrlists@REDACTED (Robert Raschke) Date: Wed, 17 Jun 2015 15:03:37 +0100 Subject: [erlang-questions] Looking for advice on simultaneous data modification In-Reply-To: References: Message-ID: Have a look at http://www.erlang.org/doc/man/global.html#trans-2 , maybe that fits your bill? /Robby On 17 June 2015 at 14:53, Daniil Churikov wrote: > Hello dear list. I am looking for advice to, perhaps, very common problem. > > I have database which does not support transactions, only CAS operations > for single record. > I have one-to-many relationship between 2 tables, and I need to implement > cascade deletion of dependent records from table_2 when main record from > table_1 was deleted. All the operations may happen in different processes > simultaneously. > So my intention is to do some kind of a mutex, which incorporate following > properties: > * when main record is in deletion-state, every other action on main and/or > dependent record should wait until it will be deleted; > * if main record is in normal-state, all dependencies may be modified > without any strict order. > > Is there any library in the wild which allow me to do this kind of mutex? > Maybe I have chosen wrong approach? Any suggestions? > > Thanks! > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis@REDACTED Wed Jun 17 12:11:06 2015 From: luis@REDACTED (Luis Gerhorst) Date: Wed, 17 Jun 2015 12:11:06 +0200 Subject: [erlang-questions] Get user input with Common Test Message-ID: Hi, I'm using Common Test to test my application. How can I prompt the user for input in a test case? I tried io:fread("Age: ", "~d") and also, after looking at the Common Test source, io:fread(user, "Age: ", "~d"). The latter one at least shows the prompt but I can't get it to continue with the test case. Best from Germany, Luis From jesper.louis.andersen@REDACTED Wed Jun 17 18:03:05 2015 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Wed, 17 Jun 2015 18:03:05 +0200 Subject: [erlang-questions] Looking for advice on simultaneous data modification In-Reply-To: References: Message-ID: On Wed, Jun 17, 2015 at 3:53 PM, Daniil Churikov wrote: > I have one-to-many relationship between 2 tables, and I need to implement > cascade deletion of dependent records from table_2 when main record from > table_1 was deleted. Another option is to have a process periodically/permanently verify the integrity and remove records which are not referenced. This means you eventually get consistent even if something goes wrong at some point. Of course, it open up a can of worms in the sense that you may have new correctness problems, but the upshot is that you can sometimes also use this in a more distributed setting. -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From elbrujohalcon@REDACTED Wed Jun 17 19:27:12 2015 From: elbrujohalcon@REDACTED (Fernando 'Brujo' Benavides) Date: Wed, 17 Jun 2015 14:27:12 -0300 Subject: [erlang-questions] ErlangBA 2015 - Today Message-ID: <66530B81-6516-42F5-8EE6-D7C4806BE049@inaka.net> Hi everybody! Today is the day! We will host ErlangBA 2015 in Inaka's office at 7PM ART (GMT-3). And for those of you who can?t attend the event in person, we?ll be broadcasting it here (or you can later see the youtube videos here ). Cheers!! Fernando "Brujo" Benavides about.me/elbrujohalcon -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Wed Jun 17 23:01:09 2015 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 17 Jun 2015 23:01:09 +0200 Subject: [erlang-questions] HTTP client with sessions support In-Reply-To: References: <79973DB2-CBFF-45B5-ADB0-54054859225E@feuerlabs.com> Message-ID: Hi! 2015-06-15 12:03 GMT+02:00 Mikl Kurkov : > On Sun, Jun 14, 2015 at 12:12 AM, Ulf Wiger wrote: > >> Creating an ets table really isn?t a heavy operation. >> > > Agree, I'm mostly concerned about dynamic atom creation in runtime, isn't > it recommended to avoid this on long running servers. > > Well, profiles was designed as to be similar to inkognito windows in chrome, and to fit the API that was once contributed to us. As such it was not expected that there would be lots and lots of profiles coming and going dynamically, and as the API was we needed to have a registered name for the profile, hence the atom. > It would be great to be able to run httpc like any other linked server > with start_link and then use its Pid to send requests without need of named > profile. Or maybe let use some safe runtime data as profile name, like ref > or string. > The profile concept could probably be extended to have "anonymous" profiles. > I see it is possible to run httpc in 'stand_alone' mode but this still > requires atom profile name. > > The 'stand-alone' mode I think was a not so brilliant compromise for having a more light wight "HTTP GET". But if there is a demand you never know what may happen. I do not recommend the 'stand-alone' mode. Regards Ingela Erlang/OTP team - Ericsson AB [...] -------------- next part -------------- An HTML attachment was scrubbed... URL: From rvirding@REDACTED Wed Jun 17 23:26:19 2015 From: rvirding@REDACTED (Robert Virding) Date: Wed, 17 Jun 2015 23:26:19 +0200 Subject: [erlang-questions] Looking for advice on simultaneous data modification In-Reply-To: References: Message-ID: How do you mean "All the operations may happen in different processes simultaneously."? Does it mean that many processes may initiate a record deletion in parallel or does it mean that there maybe be parallel accesses to the actual databases? Robert On 17 June 2015 at 15:53, Daniil Churikov wrote: > Hello dear list. I am looking for advice to, perhaps, very common problem. > > I have database which does not support transactions, only CAS operations > for single record. > I have one-to-many relationship between 2 tables, and I need to implement > cascade deletion of dependent records from table_2 when main record from > table_1 was deleted. All the operations may happen in different processes > simultaneously. > So my intention is to do some kind of a mutex, which incorporate following > properties: > * when main record is in deletion-state, every other action on main and/or > dependent record should wait until it will be deleted; > * if main record is in normal-state, all dependencies may be modified > without any strict order. > > Is there any library in the wild which allow me to do this kind of mutex? > Maybe I have chosen wrong approach? Any suggestions? > > Thanks! > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From phillip.calvin@REDACTED Wed Jun 17 23:41:42 2015 From: phillip.calvin@REDACTED (Phil Calvin) Date: Wed, 17 Jun 2015 17:41:42 -0400 Subject: [erlang-questions] SSL connection problem In-Reply-To: References: Message-ID: <5581E996.4060403@eleostech.com> On 07-06-2015 16:12, Denis Justinek wrote: > Hello! > > For the last few days I stared experiencing problems when connecting > to Apple Push Notification Service (APNS) with > Erlangs SSL. > Us too! As others have noted, it looks like Apple is testing some changes on the sandbox. Presumably they'll deploy these to the production environment sooner or later. > When trying to connect I encounter the following error: > > ... > 16:53:13.961 <0.1221.0> Undefined Undefined [error] gen_fsm <0.1221.0> > in state certify terminated with reason: no function clause matching > ssl_cipher:hash_algorithm(239) line 1196 > 16:53:13.964 <0.1221.0> Undefined Undefined [error] CRASH REPORT > Process <0.1221.0> with 0 neighbours exited with reason: no function > clause matching ssl_cipher:hash_algorithm(239) line 1196 in > gen_fsm:terminate/7 line 611 > 16:53:13.965 <0.174.0> Undefined Undefined [error] Supervisor > tls_connection_sup had child undefined started with > {tls_connection,start_link,undefined} at <0.1221.0> exit with reason > no function clause matching ssl_cipher:hash_algorithm(239) line 1196 > in context child_terminated > > Steps to reproduce (you need an APNS certificate for this): > > application:ensure_all_started(ssl). > Address = "gateway.sandbox.push.apple.com > ". > Port = 2195. > Cert = "cert.pem". > CertPass = "*****". > Options1 = [{certfile,Cert},{password,CertPass},{mode,binary}]. > Timeout = 1000. > {ok,Socket} = ssl:connect(Address, Port, Options1, Timeout). We haven't had a chance to test the proposed patches from this thread, but we were able to work around the issue by forcing the connection to use TLSv1.1 rather than TLSv1.2. Apple doesn't send the additional private Signature Hash Algorithms in the CertificateRequest when the client connects using v1.1, I think because v1.1 doesn't permit this. The following connects successfully under R16B03-1 by adding `{versions,['tlsv1.1']}` to the connect options: application:ensure_all_started(ssl). Address = "gateway.sandbox.push.apple.com". Port = 2195. Cert = "cert.pem". CertPass = "*****". Options1 = [{certfile,Cert},{password,CertPass},{mode,binary},{versions,['tlsv1.1']}]. Timeout = 1000. {ok,Socket} = ssl:connect(Address, Port, Options1, Timeout). > > If we try to connect with the same certificate by using OpenSSL from > command line (s_client) if works fine with no errors. s_client (at least the version I have, and the version shown below) doesn't support TLSv1.1 or TLSv1.2 at all, so it doesn't see these private signature algorithms at all. The s_client in OpenSSL 1.0.2 will use TLSv1.2 (when prompted with the -tls1_2 flag) and connects successfully after ignoring the unrecognized algorithms, which sounds like what the RFC dictates and Ingela's patch does. ... Requested Signature Algorithms: RSA+SHA512:DSA+SHA512:ECDSA+SHA512:0xEF+0xEF:RSA+SHA384:DSA+SHA384:ECDSA+SHA384:RSA+SHA256:DSA+SHA256:ECDSA+SHA256:0xEE+0xEE:0xED+0xED:RSA+SHA224:DSA+SHA224:ECDSA+SHA224:RSA+SHA1:DSA+SHA1:ECDSA+SHA1 Shared Requested Signature Algorithms: RSA+SHA512:DSA+SHA512:ECDSA+SHA512:RSA+SHA384:DSA+SHA384:ECDSA+SHA384:RSA+SHA256:DSA+SHA256:ECDSA+SHA256:RSA+SHA224:DSA+SHA224:ECDSA+SHA224:RSA+SHA1:DSA+SHA1:ECDSA+SHA1 > > ... > > Is this an issue with Erlang SSL module? How can it be mitigated? > > This can be reproduced on OSX and Linux - Erlang 17.4. This workaround is probably not optimal long-term, but I believe TLSv1.1 is generally considered secure (unlike, say, SSLv3) and might be more acceptable in production than running a patched OTP. I can provide decrypted Wireshark dissections / pcap files of the failing handshake if it would be helpful to the developers -- just email me privately. We'll test the proposed patch soon. Best, Phil Calvin From hellkvist@REDACTED Thu Jun 18 08:10:35 2015 From: hellkvist@REDACTED (Stefan Hellkvist) Date: Thu, 18 Jun 2015 08:10:35 +0200 Subject: [erlang-questions] Erlang and Docker Message-ID: Hi, Just out of curiosity, is anyone out there using Docker to deploy your Erlang releases? Any experiences captured in any blog out there? I am in particular interested in what docker images people are basing their deployments on. Personally I have used various Ubuntu images of varying sizes and also the phusion/baseimage (https://github.com/phusion/baseimage-docker) with good results but I would like to hear particularly if anyone has found any images with small footprints out there, capable of running Erlang releases (which is not a well defined requirement I guess, but still). Stefan From ddosia@REDACTED Thu Jun 18 11:28:41 2015 From: ddosia@REDACTED (Daniil Churikov) Date: Thu, 18 Jun 2015 10:28:41 +0100 Subject: [erlang-questions] Looking for advice on simultaneous data modification In-Reply-To: References: Message-ID: Hi Sergej. That was my intention, but I was looking for more mature solution. Maybe with some efforts `global:trans` (suggested by Robert Raschke) could be adopted. 2015-06-17 15:00 GMT+01:00 Sergej Jurecko : > Spawn a process to execute delete, use register/2 as a kind of mutex, > anyone waiting for delete to finish should attach to it with monitor/2. > > case catch register(lock,self()) of > true -> > Havelock; > {?EXIT?,_} -> > erlang:monitor(process,lock), > ?.wait for finish > end, > > Or use a proper database? Can you share with us why you?re not using one? > > > Sergej > > From: on behalf of Daniil Churikov > Date: Wednesday 17 June 2015 15:53 > To: > Subject: [erlang-questions] Looking for advice on simultaneous data > modification > > Hello dear list. I am looking for advice to, perhaps, very common problem. > > I have database which does not support transactions, only CAS operations > for single record. > I have one-to-many relationship between 2 tables, and I need to implement > cascade deletion of dependent records from table_2 when main record from > table_1 was deleted. All the operations may happen in different processes > simultaneously. > So my intention is to do some kind of a mutex, which incorporate following > properties: > * when main record is in deletion-state, every other action on main and/or > dependent record should wait until it will be deleted; > * if main record is in normal-state, all dependencies may be modified > without any strict order. > > Is there any library in the wild which allow me to do this kind of mutex? > Maybe I have chosen wrong approach? Any suggestions? > > Thanks! > _______________________________________________ erlang-questions mailing > list erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ddosia@REDACTED Thu Jun 18 11:31:41 2015 From: ddosia@REDACTED (Daniil Churikov) Date: Thu, 18 Jun 2015 10:31:41 +0100 Subject: [erlang-questions] Looking for advice on simultaneous data modification In-Reply-To: References: Message-ID: Hi Robert. This possible that main-record deletion may be initiated in the same time from different processes, but it is highly unlikely. On a contrary, dependent-records will be added/modified/deleted in highly concurrent fashion. 2015-06-17 22:26 GMT+01:00 Robert Virding : > How do you mean "All the operations may happen in different processes > simultaneously."? Does it mean that many processes may initiate a record > deletion in parallel or does it mean that there maybe be parallel accesses > to the actual databases? > > Robert > > > On 17 June 2015 at 15:53, Daniil Churikov wrote: > >> Hello dear list. I am looking for advice to, perhaps, very common problem. >> >> I have database which does not support transactions, only CAS operations >> for single record. >> I have one-to-many relationship between 2 tables, and I need to implement >> cascade deletion of dependent records from table_2 when main record from >> table_1 was deleted. All the operations may happen in different processes >> simultaneously. >> So my intention is to do some kind of a mutex, which incorporate >> following properties: >> * when main record is in deletion-state, every other action on main >> and/or dependent record should wait until it will be deleted; >> * if main record is in normal-state, all dependencies may be modified >> without any strict order. >> >> Is there any library in the wild which allow me to do this kind of mutex? >> Maybe I have chosen wrong approach? Any suggestions? >> >> Thanks! >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From radek@REDACTED Thu Jun 18 11:51:35 2015 From: radek@REDACTED (Radoslaw Gruchalski) Date: Thu, 18 Jun 2015 09:51:35 +0000 (UTC) Subject: [erlang-questions] Erlang and Docker In-Reply-To: References: Message-ID: I was playing with deploying erlang with docker, just standard trusty64 image. But out of curiosity, what's wrong with releases? Docker sounds plausible for building releases. Sent from Outlook On Wed, Jun 17, 2015 at 11:10 PM -0700, "Stefan Hellkvist" wrote: Hi, Just out of curiosity, is anyone out there using Docker to deploy your Erlang releases? Any experiences captured in any blog out there? I am in particular interested in what docker images people are basing their deployments on. Personally I have used various Ubuntu images of varying sizes and also the phusion/baseimage (https://github.com/phusion/baseimage-docker) with good results but I would like to hear particularly if anyone has found any images with small footprints out there, capable of running Erlang releases (which is not a well defined requirement I guess, but still). Stefan _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmkolesnikov@REDACTED Thu Jun 18 12:19:20 2015 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Thu, 18 Jun 2015 13:19:20 +0300 Subject: [erlang-questions] Erlang and Docker In-Reply-To: References: Message-ID: <5BFB0E21-795C-4DE7-BB47-879AF4A34141@gmail.com> Hello, We are using Docker + Erlang for multiple purposes: a) cross platform assembly of Erlang application release (e.g. using Mac to build production Linux images) b) in production to achieve blue-green deployment, isolate complex external dependencies or production deployment of Erlang application performed on hosts running vanilla Linux distribution. The major assumption -- Erlang/OTP runtime is not installed on target host. The application needs to package and deliver Erlang runtime along with its code. Erlang VM has very good isolation and cross-platform support by itself. The docker might look as an overhead. The best what is can bring is the optimisation of management practice. I?ve played with Docker public / private repositories and container image assembly from Docker file on target host. The image assembly is more appealing to me and it is successfully used by us in production. We are using Amazon, and I?ve tried to use Elastic Beanstalk and EC2 Container service. They are fine if you are building Erlang-based front-end where nodes do not talk each other. The challenge comes if you are building complicated Erlang cluster or tries to deploy existed Erlang software (e.g. Riak). Thus Chef / OpsWorks is more optimal to make life-cycle management and deployment practices. Best Regards, Dmitry > On 18 Jun 2015, at 09:10, Stefan Hellkvist wrote: > > Hi, > > Just out of curiosity, is anyone out there using Docker to deploy your Erlang releases? Any experiences captured in any blog out there? I am in particular interested in what docker images people are basing their deployments on. > > Personally I have used various Ubuntu images of varying sizes and also the phusion/baseimage (https://github.com/phusion/baseimage-docker) with good results but I would like to hear particularly if anyone has found any images with small footprints out there, capable of running Erlang releases (which is not a well defined requirement I guess, but still). > > Stefan > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From erlang@REDACTED Thu Jun 18 13:07:50 2015 From: erlang@REDACTED (Joe Armstrong) Date: Thu, 18 Jun 2015 13:07:50 +0200 Subject: [erlang-questions] program to analyse function usage Message-ID: I'd like to analyse a very large set of Erlang programs so see which functions in the standard libraries actually get used. Does anybody have a large collection of erlang modules? Failing this I guess I could scrape code from github - is there any way to programmatically fetch all erlang modules from github? - also are there some download limits that I need to be aware of - I don't want to get barred from github :-) Cheers /Joe From essen@REDACTED Thu Jun 18 13:17:54 2015 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 18 Jun 2015 13:17:54 +0200 Subject: [erlang-questions] program to analyse function usage In-Reply-To: References: Message-ID: <5582A8E2.4030704@ninenines.eu> Joe, You can use the erlang.mk index for this. It contains 458 Erlang projects today. $ git clone https://github.com/ninenines/erlang.mk $ cd erlang.mk $ make check This will download, compile and check that all projects were built properly. You can easily add your own code to perform analysis on all these projects, one at a time. Beware, it takes a few hours to do it all, and will probably take even longer if you do extra analysis. A few projects will have issues if you run OSX and/or if you don't have a necessary shared lib installed, but it should be less than 20 total so you still have almost 440 projects to analyse. I'm available later today if you have questions. On 06/18/2015 01:07 PM, Joe Armstrong wrote: > I'd like to analyse a very large set of Erlang programs so see which > functions in the standard libraries actually get used. > > Does anybody have a large collection of erlang modules? > > Failing this I guess I could scrape code from github - is there any way to > programmatically fetch all erlang modules from github? - also are there some > download limits that I need to be aware of - I don't want to get > barred from github :-) > > Cheers > > /Joe > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu From essen@REDACTED Thu Jun 18 13:20:11 2015 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Thu, 18 Jun 2015 13:20:11 +0200 Subject: [erlang-questions] program to analyse function usage In-Reply-To: <5582A8E2.4030704@ninenines.eu> References: <5582A8E2.4030704@ninenines.eu> Message-ID: <5582A96B.4060907@ninenines.eu> Forgot to say, On 06/18/2015 01:17 PM, Lo?c Hoguin wrote: > Joe, > > You can use the erlang.mk index for this. It contains 458 Erlang > projects today. The *index* contains 458 projects. But some of them fetch dependencies that are not in the index, so the total of projects fetched that you can analyze is closer to 600. > $ git clone https://github.com/ninenines/erlang.mk > $ cd erlang.mk > $ make check > > This will download, compile and check that all projects were built > properly. You can easily add your own code to perform analysis on all > these projects, one at a time. > > Beware, it takes a few hours to do it all, and will probably take even > longer if you do extra analysis. > > A few projects will have issues if you run OSX and/or if you don't have > a necessary shared lib installed, but it should be less than 20 total so > you still have almost 440 projects to analyse. > > I'm available later today if you have questions. > > On 06/18/2015 01:07 PM, Joe Armstrong wrote: >> I'd like to analyse a very large set of Erlang programs so see which >> functions in the standard libraries actually get used. >> >> Does anybody have a large collection of erlang modules? >> >> Failing this I guess I could scrape code from github - is there any >> way to >> programmatically fetch all erlang modules from github? - also are >> there some >> download limits that I need to be aware of - I don't want to get >> barred from github :-) >> >> Cheers >> >> /Joe >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -- Lo?c Hoguin http://ninenines.eu From cjsvance@REDACTED Thu Jun 18 13:24:28 2015 From: cjsvance@REDACTED (Christopher Vance) Date: Thu, 18 Jun 2015 21:24:28 +1000 Subject: [erlang-questions] Erlang and Docker In-Reply-To: <5BFB0E21-795C-4DE7-BB47-879AF4A34141@gmail.com> References: <5BFB0E21-795C-4DE7-BB47-879AF4A34141@gmail.com> Message-ID: We build and deploy an Erlang service using two Debian Jessie images. The first image contains an Erlang compiler and is used to build a release into a host-based volume. The second image is built using that release. The only Erlang system on the second image is the release. This is the one we deploy. On Thu, Jun 18, 2015 at 8:19 PM, Dmitry Kolesnikov wrote: > Hello, > > We are using Docker + Erlang for multiple purposes: > > a) cross platform assembly of Erlang application release (e.g. using Mac > to build production Linux images) > > b) in production to achieve blue-green deployment, isolate complex > external dependencies or production deployment of Erlang application > performed on hosts running vanilla Linux distribution. The major assumption > -- Erlang/OTP runtime is not installed on target host. The application > needs to package and deliver Erlang runtime along with its code. > > Erlang VM has very good isolation and cross-platform support by itself. > The docker might look as an overhead. The best what is can bring is the > optimisation of management practice. > > I?ve played with Docker public / private repositories and container image > assembly from Docker file on target host. The image assembly is more > appealing to me and it is successfully used by us in production. > > We are using Amazon, and I?ve tried to use Elastic Beanstalk and EC2 > Container service. They are fine if you are building Erlang-based front-end > where nodes do not talk each other. The challenge comes if you are building > complicated Erlang cluster or tries to deploy existed Erlang software (e.g. > Riak). Thus Chef / OpsWorks is more optimal to make life-cycle management > and deployment practices. > > > Best Regards, > Dmitry > > > > On 18 Jun 2015, at 09:10, Stefan Hellkvist wrote: > > > > Hi, > > > > Just out of curiosity, is anyone out there using Docker to deploy your > Erlang releases? Any experiences captured in any blog out there? I am in > particular interested in what docker images people are basing their > deployments on. > > > > Personally I have used various Ubuntu images of varying sizes and also > the phusion/baseimage (https://github.com/phusion/baseimage-docker) with > good results but I would like to hear particularly if anyone has found any > images with small footprints out there, capable of running Erlang releases > (which is not a well defined requirement I guess, but still). > > > > Stefan > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Christopher Vance -------------- next part -------------- An HTML attachment was scrubbed... URL: From marlus.saraiva@REDACTED Thu Jun 18 13:18:57 2015 From: marlus.saraiva@REDACTED (Marlus Saraiva) Date: Thu, 18 Jun 2015 08:18:57 -0300 Subject: [erlang-questions] Erlang and Docker In-Reply-To: References: Message-ID: Hi Stefan, In case you're looking for images with small footprints, give Alpine Linux a try. You can have a minimal Erlang image starting from 16.22MB. More info and examples can be found here: https://github.com/msaraiva/docker-alpine Cheers, -marlus 2015-06-18 3:10 GMT-03:00 Stefan Hellkvist : > Hi, > > Just out of curiosity, is anyone out there using Docker to deploy your > Erlang releases? Any experiences captured in any blog out there? I am in > particular interested in what docker images people are basing their > deployments on. > > Personally I have used various Ubuntu images of varying sizes and also the > phusion/baseimage (https://github.com/phusion/baseimage-docker) with good > results but I would like to hear particularly if anyone has found any > images with small footprints out there, capable of running Erlang releases > (which is not a well defined requirement I guess, but still). > > Stefan > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From rpettit@REDACTED Thu Jun 18 16:31:18 2015 From: rpettit@REDACTED (Rick Pettit) Date: Thu, 18 Jun 2015 09:31:18 -0500 Subject: [erlang-questions] Erlang and Docker In-Reply-To: References: Message-ID: <3D01227D-7F2B-43BA-81EF-9D8B381C5F92@vailsys.com> We are in the process of trying out Erlang-in-Docker (but haven?t actually gotten that working just yet): https://github.com/taotaotheripper/Erlang-In-Docker -Rick > On Jun 18, 2015, at 6:18 AM, Marlus Saraiva wrote: > > Hi Stefan, > > In case you're looking for images with small footprints, give Alpine Linux a try. You can have a minimal Erlang image starting from 16.22MB. More info and examples can be found here: > https://github.com/msaraiva/docker-alpine > > Cheers, > -marlus > > 2015-06-18 3:10 GMT-03:00 Stefan Hellkvist : > Hi, > > Just out of curiosity, is anyone out there using Docker to deploy your Erlang releases? Any experiences captured in any blog out there? I am in particular interested in what docker images people are basing their deployments on. > > Personally I have used various Ubuntu images of varying sizes and also the phusion/baseimage (https://github.com/phusion/baseimage-docker) with good results but I would like to hear particularly if anyone has found any images with small footprints out there, capable of running Erlang releases (which is not a well defined requirement I guess, but still). > > Stefan > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From rdm@REDACTED Thu Jun 18 17:19:34 2015 From: rdm@REDACTED (Rich Morin) Date: Thu, 18 Jun 2015 08:19:34 -0700 Subject: [erlang-questions] program to analyse function usage In-Reply-To: References: Message-ID: <93A4302A-FCBE-4D29-8B3B-2F700AC4F3CC@cfcl.com> > I'd like to analyse a very large set of Erlang programs to see > which functions in the standard libraries actually get used. The definition of "actually get used" is a tricky one. If my code references a function (directly or indirectly), but only calls it in very unusual circumstances, is that of interest? Incidentally, this question brings to mind the notion of "tree shaking", as performed by Google's Closure compiler: https://developers.google.com/closure/compiler/ The ClojureScript folks use this to eliminate functions from their generated code sets. It might be that a similar approach could be used to optimize the loading of Erlang functions. > Does anybody have a large collection of erlang modules? I don't have much to offer except for this tiny list, but I'd be very interested in knowing about what you find: http://wiki.cfcl.com/Projects/Elixir/Erlex/Testing#Code_Bases Given that disk is basically free in the amounts you'll need, it might be worthwhile to think about setting up the collection as a long-term community resource for assorted analytic efforts. > Failing this I guess I could scrape code from github - is there > any way to programmatically fetch all erlang modules from github? I'm pretty sure that there's no single command that would pull down all of the Erlang modules from GitHub, but there's a REST API that would let you assemble a list of prospects, download files, etc: https://developer.github.com/v3 > also are there some download limits that I need to be > aware of - I don't want to get barred from github :-) Once you have scaled the problem (i.e., assembled a pick list with size statistics), you might want to contact them with a detailed question. Even if it doesn't get a useful response, you'll have given them fair warning... https://github.com/contact?form%5Bsubject%5D=APIv3 -r -- http://www.cfcl.com/rdm Rich Morin rdm@REDACTED http://www.cfcl.com/rdm/resume San Bruno, CA, USA +1 650-873-7841 Software system design, development, and documentation From pierrefenoll@REDACTED Thu Jun 18 17:57:01 2015 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Thu, 18 Jun 2015 08:57:01 -0700 Subject: [erlang-questions] program to analyse function usage In-Reply-To: <93A4302A-FCBE-4D29-8B3B-2F700AC4F3CC@cfcl.com> References: <93A4302A-FCBE-4D29-8B3B-2F700AC4F3CC@cfcl.com> Message-ID: <29F7441E-5640-4A13-A601-ECBED5491B17@gmail.com> You can use the index at other.erldocs.com/apps.js for a list of >10k Erlang projects, then the meta information (Erlang terms) at other.erldocs.com/Site/User/Repo/meta.txt if you need it. The website is updated daily. I'm working on adding a pass that would enable people to run their code in order to get more information out of all those projects. But uh. That's in the works. On 18 Jun 2015, at 08:19, Rich Morin wrote: >> I'd like to analyse a very large set of Erlang programs to see >> which functions in the standard libraries actually get used. > > The definition of "actually get used" is a tricky one. If my > code references a function (directly or indirectly), but only > calls it in very unusual circumstances, is that of interest? > > Incidentally, this question brings to mind the notion of "tree > shaking", as performed by Google's Closure compiler: > > https://developers.google.com/closure/compiler/ > > The ClojureScript folks use this to eliminate functions from > their generated code sets. It might be that a similar approach > could be used to optimize the loading of Erlang functions. > > >> Does anybody have a large collection of erlang modules? > > I don't have much to offer except for this tiny list, but I'd > be very interested in knowing about what you find: > > http://wiki.cfcl.com/Projects/Elixir/Erlex/Testing#Code_Bases > > Given that disk is basically free in the amounts you'll need, it > might be worthwhile to think about setting up the collection as > a long-term community resource for assorted analytic efforts. > > >> Failing this I guess I could scrape code from github - is there >> any way to programmatically fetch all erlang modules from github? > > I'm pretty sure that there's no single command that would pull > down all of the Erlang modules from GitHub, but there's a REST > API that would let you assemble a list of prospects, download > files, etc: > > https://developer.github.com/v3 > > >> also are there some download limits that I need to be >> aware of - I don't want to get barred from github :-) > > Once you have scaled the problem (i.e., assembled a pick list > with size statistics), you might want to contact them with > a detailed question. Even if it doesn't get a useful response, > you'll have given them fair warning... > > https://github.com/contact?form%5Bsubject%5D=APIv3 > > -r > > -- > http://www.cfcl.com/rdm Rich Morin rdm@REDACTED > http://www.cfcl.com/rdm/resume San Bruno, CA, USA +1 650-873-7841 > > Software system design, development, and documentation > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From roberto.ostinelli@REDACTED Thu Jun 18 19:10:09 2015 From: roberto.ostinelli@REDACTED (Roberto Ostinelli) Date: Thu, 18 Jun 2015 19:10:09 +0200 Subject: [erlang-questions] node is up Message-ID: <956E66CF-06D2-4A72-B594-677345B6460D@widetag.com> Dear list, what is the recommended way to receive an event when a node gets added to the cluster? From elbrujohalcon@REDACTED Thu Jun 18 19:13:38 2015 From: elbrujohalcon@REDACTED (Fernando 'Brujo' Benavides) Date: Thu, 18 Jun 2015 14:13:38 -0300 Subject: [erlang-questions] node is up In-Reply-To: <956E66CF-06D2-4A72-B594-677345B6460D@widetag.com> References: <956E66CF-06D2-4A72-B594-677345B6460D@widetag.com> Message-ID: <5C827047-590C-4886-BB70-A9C2B6EA9871@inaka.net> We usually use net_kernel:monitor_nodes[1] for that purpose at Inaka. If you want to see an example of that function being used in a module, you can check gold_fever?s node_monitor[2] Hope this helps :) Fernando "Brujo" Benavides about.me/elbrujohalcon [1] http://erlang.org/doc/man/net_kernel.html#monitor_nodes-1 [2] https://github.com/inaka/gold_fever/blob/master/src/gf_node_monitor.erl > On Jun 18, 2015, at 14:10, Roberto Ostinelli wrote: > > Dear list, > what is the recommended way to receive an event when a node gets added to the cluster? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From roberto@REDACTED Fri Jun 19 11:59:15 2015 From: roberto@REDACTED (Roberto Ostinelli) Date: Fri, 19 Jun 2015 11:59:15 +0200 Subject: [erlang-questions] node is up In-Reply-To: <5C827047-590C-4886-BB70-A9C2B6EA9871@inaka.net> References: <956E66CF-06D2-4A72-B594-677345B6460D@widetag.com> <5C827047-590C-4886-BB70-A9C2B6EA9871@inaka.net> Message-ID: Thank you Fernando! On Thu, Jun 18, 2015 at 7:13 PM, Fernando 'Brujo' Benavides < elbrujohalcon@REDACTED> wrote: > We usually use net_kernel:monitor_nodes[1] for that purpose at Inaka. > > If you want to see an example of that function being used in a module, you > can check gold_fever?s node_monitor[2] > > Hope this helps :) > > > Fernando "Brujo" Benavides > about.me/elbrujohalcon > > [1] http://erlang.org/doc/man/net_kernel.html#monitor_nodes-1 > [2] > https://github.com/inaka/gold_fever/blob/master/src/gf_node_monitor.erl > > > > > On Jun 18, 2015, at 14:10, Roberto Ostinelli < > roberto.ostinelli@REDACTED> wrote: > > > > Dear list, > > what is the recommended way to receive an event when a node gets added > to the cluster? > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Fri Jun 19 14:29:19 2015 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Fri, 19 Jun 2015 14:29:19 +0200 Subject: [erlang-questions] A nice code upgrade trick from Andy Tanenbaum Message-ID: Hi list, I was watching this nice youtube talk where Andrew Tanenbaum talks about work his students have done to port MINIX 3 to NetBSD[0]. Observations: * "MINIX 3" is basically "Erlang/OTP" * Restarts of processes through a "reincarnation server" (read: supervisor). * Isolated memory spaces of drivers through MMU * Capability oriented: Only the disk driver is allowed to manipulate disk driver registers. The audio driver may only do stuff with sound. It may not talk to the network. * Hot code upgrades of drivers. Now the last part has a trick which I had not seen before. Suppose we have a function code_change/2 (not /3 for simplicity) allowing us to up and downgrade between versions. Then they do: upgrade(OldVsn, NextVsn, State) -> NextState = code_change(NextVsn, State), case code_change({down, OldVsn}, NextState) of State -> {ok, NextState}; _ -> {error, abort_code_upgrade} end. That is, they upgrade the state and immediately downgrade it again. If there is any discrepancy here, then they abort the upgrade. According to Tanenbaum this captures a remarkable number of botched upgrades. If we are not doing this, we may want to transplant the idea into OTP. [0] https://www.youtube.com/watch?v=0pebP891V0c -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Fri Jun 19 15:47:14 2015 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Fri, 19 Jun 2015 15:47:14 +0200 Subject: [erlang-questions] [ANN] The Erlanger Playbook early release Message-ID: <55841D62.1070400@ninenines.eu> Hello, I hope it's OK for me to announce on erlang-questions: The Erlanger Playbook, a book about software development using Erlang, has been *early* released! The book is meant to be the missing developer manual. It covers all steps from the start of a project to its release including writing code, documentation and tests. There are books for learning Erlang, for running Erlang in production, but not much for modern Erlang development. This is where The Erlanger Playbook comes in. This is an early release. An update will be sent to everyone about every month or so. I plan to cover anything that relates to the development of Erlang software, ie the "dev" in "devops". Many tools and techniques will be covered in future updates. We will do a print book if there is enough interest once the book gets finished, but we're a few months off for now. :-) You can get more information here: http://ninenines.eu/articles/erlanger-playbook/ Thanks for your interest! -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From bchesneau@REDACTED Fri Jun 19 18:10:15 2015 From: bchesneau@REDACTED (Benoit Chesneau) Date: Fri, 19 Jun 2015 16:10:15 +0000 Subject: [erlang-questions] Looking for advice on simultaneous data modification In-Reply-To: References: Message-ID: maybe locks could work for your case also? https://github.com/uwiger/locks - beno?t On Thu 18 Jun 2015 at 11:31 Daniil Churikov wrote: > Hi Robert. This possible that main-record deletion may be initiated in the > same time from different processes, > but it is highly unlikely. > On a contrary, dependent-records will be added/modified/deleted in highly > concurrent fashion. > > 2015-06-17 22:26 GMT+01:00 Robert Virding : > >> How do you mean "All the operations may happen in different processes >> simultaneously."? Does it mean that many processes may initiate a record >> deletion in parallel or does it mean that there maybe be parallel accesses >> to the actual databases? >> >> Robert >> >> >> On 17 June 2015 at 15:53, Daniil Churikov wrote: >> >>> Hello dear list. I am looking for advice to, perhaps, very common >>> problem. >>> >>> I have database which does not support transactions, only CAS operations >>> for single record. >>> I have one-to-many relationship between 2 tables, and I need to >>> implement cascade deletion of dependent records from table_2 when main >>> record from table_1 was deleted. All the operations may happen in different >>> processes simultaneously. >>> So my intention is to do some kind of a mutex, which incorporate >>> following properties: >>> * when main record is in deletion-state, every other action on main >>> and/or dependent record should wait until it will be deleted; >>> * if main record is in normal-state, all dependencies may be modified >>> without any strict order. >>> >>> Is there any library in the wild which allow me to do this kind of mutex? >>> Maybe I have chosen wrong approach? Any suggestions? >>> >>> Thanks! >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From nyarly@REDACTED Fri Jun 19 19:41:49 2015 From: nyarly@REDACTED (Judson Lester) Date: Fri, 19 Jun 2015 17:41:49 +0000 Subject: [erlang-questions] Simultaneous Common Test Message-ID: I ran into a weird issue fooling around with common_test: attempting to run more than one CT instance at a time causes problems because they all want ct@REDACTED as their node name. I started to look for a setting for the CT node name, and quickly got caught up in the master/slave interaction stuff, which seems to be both overkill for what I want and not a great fit. Specifically, I was trying to run each suite in its own process in parallel. Notionally: for s in test/*_SUITE.beam; do ct_run -suite $s &; done Is there an easy way to do this that I'm missing? Judson -------------- next part -------------- An HTML attachment was scrubbed... URL: From sergej.jurecko@REDACTED Fri Jun 19 19:45:27 2015 From: sergej.jurecko@REDACTED (Sergej Jurecko) Date: Fri, 19 Jun 2015 19:45:27 +0200 Subject: [erlang-questions] Simultaneous Common Test In-Reply-To: References: Message-ID: <34F1FE0E-363D-4037-AC74-6116B1C16A57@gmail.com> This is why I wrote and use https://github.com/biokoda/detest Sergej From: on behalf of Judson Lester Date: Friday 19 June 2015 19:41 To: Erlang Users' List Subject: [erlang-questions] Simultaneous Common Test I ran into a weird issue fooling around with common_test: attempting to run more than one CT instance at a time causes problems because they all want ct@REDACTED as their node name. I started to look for a setting for the CT node name, and quickly got caught up in the master/slave interaction stuff, which seems to be both overkill for what I want and not a great fit. Specifically, I was trying to run each suite in its own process in parallel. Notionally: for s in test/*_SUITE.beam; do ct_run -suite $s &; done Is there an easy way to do this that I'm missing? Judson _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Sat Jun 20 12:14:42 2015 From: roger@REDACTED (Roger Lipscombe) Date: Sat, 20 Jun 2015 11:14:42 +0100 Subject: [erlang-questions] Simultaneous Common Test In-Reply-To: References: Message-ID: I just tried the following and it seemed to change the node name successfully. ct_run -suite $SUITE -erl_args -sname foo On 19 June 2015 at 18:41, Judson Lester wrote: > I ran into a weird issue fooling around with common_test: attempting to run > more than one CT instance at a time causes problems because they all want > ct@REDACTED as their node name. > > I started to look for a setting for the CT node name, and quickly got caught > up in the master/slave interaction stuff, which seems to be both overkill > for what I want and not a great fit. > > Specifically, I was trying to run each suite in its own process in parallel. > Notionally: for s in test/*_SUITE.beam; do ct_run -suite $s &; done > > Is there an easy way to do this that I'm missing? > > Judson > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From emailyama@REDACTED Sat Jun 20 22:10:34 2015 From: emailyama@REDACTED (Max Tretyakov) Date: Sat, 20 Jun 2015 23:10:34 +0300 Subject: [erlang-questions] Ranch and cleaning after client Message-ID: <001A92B5-E466-4A72-900C-EE0E565F2DED@ya.ru> Hi all, I am using ranch to accept/handle clients in our app, but I have some feelings that there is some scenario when I can?t handle cleaning up after client disconnection/tcp_error/idle timeout in terminate callback. I am using ranch_protocol in way(simplified): init(Ref, Socket, Transport, _Opts = []) -> ok = proc_lib:init_ack({ok, self()}), ok = ranch:accept_ack(Ref), process_flag(trap_exit, true), ?.. gen_server:enter_loop(?MODULE, [], #client{socket=Socket, transport=Transport}, ?IDLE_SOCKET_TIMEOUT). %1 min handle_info({tcp_closed, _Socket}, State=#client{user = User}) -> %closed by client {stop, normal, State}; handle_info({'EXIT', FromPid, Reason}, State) -> %exit signal {stop, normal, State}; handle_info({tcp_error, _, Reason}, State) -> {stop, Reason, State}; handle_info(timeout, State=#client{user = User}) -> {stop, normal, State}; handle_info(_Info, State=#client{user = User}) -> %catch all {stop, normal, State}. ?.. terminate(Reason, _State=#client{user = User, auth = Auth, socket = Socket}) -> gen_tcp:close(Socket), case Auth =:= true andalso User =/= undefined of true -> users:quite(User); false -> ok end, ok. In users:quite module ? it is simple ets table with connections counter(increment/decrement, and deleting when connections get <= 0). My questions: there is a scenario when cleaning up after client couldn?t happen in my case ? I now 1 possible variant, when you stopping listener, and in some situation supervisor could kill process, so cleaning never happen, but we don?t use this feature. Any advice how make correct cleaning up handling ? Thank you! From bchesneau@REDACTED Sun Jun 21 18:35:04 2015 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sun, 21 Jun 2015 16:35:04 +0000 Subject: [erlang-questions] Erlang meetup in Paris In-Reply-To: References: Message-ID: Just a quick follow-up. The program of the meetup has been published there: http://erlang.paris Hope to see some of you there :) - beno?t On Tue, Jun 16, 2015 at 11:12 AM Benoit Chesneau wrote: > Date has been switched to the Monday 29 June at 6:30 PM in the office of > Xebia: > > http://www.meetup.com/Erlang-Paris/events/222956412/ > > CFP are still welcome :) > > Hope to see you there! > > - beno?t > > On Thu, Jun 4, 2015 at 10:03 AM Benoit Chesneau > wrote: > >> We are organising a french meetup about "Erlang and it's ecosystem" on >> 06-23 in Paris : >> >> http://www.meetup.com/Erlang-Paris/events/222956412/ >> >> The location is still to define. If you want to talk about your usage of >> Erlang, Elixir or LFE, the CFP is there: >> >> http://goo.gl/forms/fgiU1uqZFE >> >> Looking forward to see you there :) >> >> - beno?t >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Sun Jun 21 19:48:33 2015 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Sun, 21 Jun 2015 19:48:33 +0200 Subject: [erlang-questions] [ANN] rebar 2.6.0 Message-ID: It's been way too long since the last (2.5.1) release, but rebar 2.6.0 has finally arrived. Thanks to everybody involved, especially Fred for taking care of PR mgmt and cutting the release. Noteworthy changes: * Selectable compiler for .proto files (protobuffs or gpb) * Additional .proto compile improvements * Additional .erl compile improvements * New Dialyzer plugin (build-plt, check-plt, delete-plt, dialyze) * Dependencies of C and C++ sources are taken into consideration * fish shell completion script Full changelog: https://github.com/rebar/rebar/releases/tag/2.6.0 From plug.gulp@REDACTED Sun Jun 21 19:11:07 2015 From: plug.gulp@REDACTED (Plug Gulp) Date: Sun, 21 Jun 2015 18:11:07 +0100 Subject: [erlang-questions] [Newbie] Failed/Skipped Erlang tests question... Message-ID: Hi, I am new to Erlang. I am running Ubuntu 15.04 on my laptop at home and connect to wifi using dhcp. I built Erlang from Git repo using the following command: ./otp_build setup -a --prefix=$HOME/Erlang/install --with-libatomic_ops=$HOME/Erlang/libatomic_ops Then I built the testsuite using: ./otp_build tests $HOME/Erlang/tests And then ran the tests using following command: $ERL_TOP/bin/erl -s ts install -s ts smoke_test batch -s init stop I get some test failures and some tests are skipped. How do I make these tests pass or are the results expected? The failed and skipped test logs are as follows: tests.kernel_test.inet_SUITE.cases ========================== =case inet_SUITE:t_gethostbyaddr =logfile inet_suite.t_gethostbyaddr.html =started 2015-06-21 05:30:07 =ended 2015-06-21 05:30:07 =result auto_skipped: {require_failed, {not_available,test_host_ipv4_only}} =case inet_SUITE:t_gethostbyname =logfile inet_suite.t_gethostbyname.html =started 2015-06-21 05:30:07 =ended 2015-06-21 05:30:07 =result auto_skipped: {require_failed, {not_available,test_host_ipv4_only}} =case inet_SUITE:t_gethostbyaddr_v6 =logfile inet_suite.t_gethostbyaddr_v6.html =started 2015-06-21 05:30:07 =ended 2015-06-21 05:30:07 =result auto_skipped: {require_failed, {not_available,test_host_ipv6_only}} =case inet_SUITE:t_gethostbyname_v6 =logfile inet_suite.t_gethostbyname_v6.html =started 2015-06-21 05:30:07 =ended 2015-06-21 05:30:07 =result auto_skipped: {require_failed, {not_available,test_host_ipv6_only}} tests.kernel_test.inet_res_SUITE.cases ============================= =case inet_res_SUITE:gethostbyaddr =logfile inet_res_suite.gethostbyaddr.html =started 2015-06-21 05:30:09 =ended 2015-06-21 05:30:09 =result auto_skipped: {require_failed, {not_available,test_host_ipv4_only}} =case inet_res_SUITE:gethostbyname =logfile inet_res_suite.gethostbyname.html =started 2015-06-21 05:30:09 =ended 2015-06-21 05:30:10 =result auto_skipped: {require_failed, {not_available,test_host_ipv4_only}} =case inet_res_SUITE:gethostbyaddr_v6 =logfile inet_res_suite.gethostbyaddr_v6.html =started 2015-06-21 05:30:10 =ended 2015-06-21 05:30:10 =result auto_skipped: {require_failed, {not_available,test_host_ipv6_only}} =case inet_res_SUITE:gethostbyname_v6 =logfile inet_res_suite.gethostbyname_v6.html =started 2015-06-21 05:30:10 =ended 2015-06-21 05:30:10 =result auto_skipped: {require_failed, {not_available,test_host_ipv6_only}} =case inet_res_SUITE:basic =logfile inet_res_suite.basic.html =started 2015-06-21 05:30:10 =ended 2015-06-21 05:30:10 =result skipped: "Name server not found!" tests.system_test.ethread_SUITE ========================= =case ethread_SUITE:max_threads =started 2015-06-21 05:31:41 =result skipped: Skip tests.emulator_test.time_SUITE ======================= =case time_SUITE:univ_to_local =logfile time_suite.univ_to_local.html =started 2015-06-21 05:29:56 =ended 2015-06-21 05:29:56 =result failed: {{badmatch,{{1996,1,30},{12,45,7}}}, [{time_SUITE,test_univ_to_local,1, [{file,"time_SUITE.erl"},{line,123}]}, {test_server,ts_tc,3, [{file,"test_server.erl"},{line,1450}]}, {test_server,run_test_case_eval1,6, [{file,"test_server.erl"},{line,1026}]}, {test_server,run_test_case_eval,9, [{file,"test_server.erl"},{line,968}]}]}, [{time_SUITE, test_univ_to_local, 123}, {test_server, ts_tc, 1450}, {test_server, run_test_case_eval1, 1026}, {test_server, run_test_case_eval, 968}] =case time_SUITE:local_to_univ =logfile time_suite.local_to_univ.html =started 2015-06-21 05:29:56 =ended 2015-06-21 05:29:56 =result failed: {{badmatch,{{1996,1,30},{13,45,7}}}, [{time_SUITE,test_local_to_univ,1, [{file,"time_SUITE.erl"},{line,135}]}, {test_server,ts_tc,3, [{file,"test_server.erl"},{line,1450}]}, {test_server,run_test_case_eval1,6, [{file,"test_server.erl"},{line,1026}]}, {test_server,run_test_case_eval,9, [{file,"test_server.erl"},{line,968}]}]}, [{time_SUITE, test_local_to_univ, 135}, {test_server, ts_tc, 1450}, {test_server, run_test_case_eval1, 1026}, {test_server, run_test_case_eval, 968}] =case time_SUITE:consistency =logfile time_suite.consistency.html =started 2015-06-21 05:29:57 =ended 2015-06-21 05:29:57 =result failed: {{badmatch,error}, [{time_SUITE,consistency,1, [{file,"time_SUITE.erl"},{line,209}]}, {test_server,ts_tc,3, [{file,"test_server.erl"},{line,1450}]}, {test_server,run_test_case_eval1,6, [{file,"test_server.erl"},{line,1026}]}, {test_server,run_test_case_eval,9, [{file,"test_server.erl"},{line,968}]}]}, [{time_SUITE, consistency, 209}, {test_server, ts_tc, 1450}, {test_server, run_test_case_eval1, 1026}, {test_server, run_test_case_eval, 968}] Kind regards, ~Plug From hellkvist@REDACTED Mon Jun 22 07:59:12 2015 From: hellkvist@REDACTED (Stefan Hellkvist) Date: Mon, 22 Jun 2015 07:59:12 +0200 Subject: [erlang-questions] Erlang and Docker In-Reply-To: <3D01227D-7F2B-43BA-81EF-9D8B381C5F92@vailsys.com> References: <3D01227D-7F2B-43BA-81EF-9D8B381C5F92@vailsys.com> Message-ID: Thank you for the information. I will look into both the Alpine image and the Erlang-In-Docker project. For my current use cases there is currently no need for erlang communication outside the container (I use docker primarily to have a unified deployment format in a multi-language service and for the namespaces separation) but it sounds like an interesting feature for a distributed erlang scenario. Thanks! On Thu, Jun 18, 2015 at 4:31 PM, Rick Pettit wrote: > We are in the process of trying out Erlang-in-Docker (but haven?t actually > gotten that working just yet): > > https://github.com/taotaotheripper/Erlang-In-Docker > > -Rick > > > On Jun 18, 2015, at 6:18 AM, Marlus Saraiva > wrote: > > > > Hi Stefan, > > > > In case you're looking for images with small footprints, give Alpine > Linux a try. You can have a minimal Erlang image starting from 16.22MB. > More info and examples can be found here: > > https://github.com/msaraiva/docker-alpine > > > > Cheers, > > -marlus > > > > 2015-06-18 3:10 GMT-03:00 Stefan Hellkvist : > > Hi, > > > > Just out of curiosity, is anyone out there using Docker to deploy your > Erlang releases? Any experiences captured in any blog out there? I am in > particular interested in what docker images people are basing their > deployments on. > > > > Personally I have used various Ubuntu images of varying sizes and also > the phusion/baseimage (https://github.com/phusion/baseimage-docker) with > good results but I would like to hear particularly if anyone has found any > images with small footprints out there, capable of running Erlang releases > (which is not a well defined requirement I guess, but still). > > > > Stefan > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From marc@REDACTED Mon Jun 22 10:04:45 2015 From: marc@REDACTED (Marc Worrell) Date: Mon, 22 Jun 2015 10:04:45 +0200 Subject: [erlang-questions] [ANN] rebar 2.6.0 In-Reply-To: References: Message-ID: <85E28018-9897-4449-88C9-5FB3D00789D5@worrell.nl> Tuncer, Thank you, and also the other contributors, for all your work on this essential piece of software! Cheers, Marc > On 21 jun. 2015, at 19:48, Tuncer Ayaz wrote: > > It's been way too long since the last (2.5.1) release, but rebar 2.6.0 > has finally arrived. Thanks to everybody involved, especially Fred > for taking care of PR mgmt and cutting the release. > > Noteworthy changes: > > * Selectable compiler for .proto files (protobuffs or gpb) > * Additional .proto compile improvements > * Additional .erl compile improvements > * New Dialyzer plugin (build-plt, check-plt, delete-plt, dialyze) > * Dependencies of C and C++ sources are taken into consideration > * fish shell completion script > > Full changelog: https://github.com/rebar/rebar/releases/tag/2.6.0 > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From bchesneau@REDACTED Mon Jun 22 11:04:49 2015 From: bchesneau@REDACTED (Benoit Chesneau) Date: Mon, 22 Jun 2015 09:04:49 +0000 Subject: [erlang-questions] question about cacertfiles option Message-ID: In hackney, by default the HTTPS connection is using the following options: [{verify_fun, {fun ssl_verify_hostname:verify_fun/3, [{check_hostname, Host}]}}, {cacertfile, CACertFile }, {server_name_indication, Host}, {verify, verify_peer}, {depth, 99}, {reuse_sessions, true}] Where the Host is based on the Url. CaCertFile is this one: https://github.com/benoitc/hackney/blob/master/priv/ca-bundle.crt And the verify_fun is here: https://github.com/deadtrickster/ssl_verify_hostname.erl/blob/master/src/ssl_verify_hostname.erl It works in most cases but when connecting to Twillio I get the following error: 2> hackney:get("https://api.twilio.com/2010-04-01/Accounts/"). =ERROR REPORT==== 22-Jun-2015::10:46:28 === SSL: certify: ssl_handshake.erl:1403:Fatal error: unknown ca {error,{tls_alert,"unknown ca"}} When checking the CA files it seems it contains the thawte certificaes: $ cat priv/ca-bundle.crt|grep thawte thawte Primary Root CA thawte Primary Root CA - G2 thawte Primary Root CA - G3 Before opening a ticket I was wondering if I missed something in my configuration? Is there anything wrong in the CA file? Any option is missing? - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From phongmh307@REDACTED Mon Jun 22 14:24:25 2015 From: phongmh307@REDACTED (Phong Mai) Date: Mon, 22 Jun 2015 19:24:25 +0700 Subject: [erlang-questions] How to supervise multi workers Message-ID: Hi there, I?m trying to build my first Erlang OTP application but stuck at supervising my workers. My application has a central worker to get messages from RabbitMQ then, depends on the messages, tasks will be distributed to poolboy worker to process the task. I tried few methods but unable to make both supervisors work. http://damntechnology.blogspot.com/2011/10/erlang-supervising-two-processes-from.html Best Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From dave@REDACTED Mon Jun 22 16:05:52 2015 From: dave@REDACTED (David Goehrig) Date: Mon, 22 Jun 2015 10:05:52 -0400 Subject: [erlang-questions] Erlang and Docker In-Reply-To: References: <3D01227D-7F2B-43BA-81EF-9D8B381C5F92@vailsys.com> Message-ID: At work, we've been deploying a wide range of Erlang apps on Docker. I'm working on a blog post ( and presentation ) on how we manage our containers across multiple cloud providers. The biggest gotchas tend to be around: * epmd port mapping and exposing a range of ports for clustering * volume mounting and mnesia data stores * short names and docker's dns implementation We deploy Erlang application on both Ubunutu and Centos, and deploy in Rackspace, OpenStack, MS Azure, EC2, and VirtualBox. When the post is ready I'll ping the list, we're redoing our developer blog this week. Dave On Mon, Jun 22, 2015 at 1:59 AM, Stefan Hellkvist wrote: > Thank you for the information. I will look into both the Alpine image and > the Erlang-In-Docker project. For my current use cases there is currently > no need for erlang communication outside the container (I use docker > primarily to have a unified deployment format in a multi-language service > and for the namespaces separation) but it sounds like an interesting > feature for a distributed erlang scenario. Thanks! > > On Thu, Jun 18, 2015 at 4:31 PM, Rick Pettit wrote: > >> We are in the process of trying out Erlang-in-Docker (but haven?t >> actually gotten that working just yet): >> >> https://github.com/taotaotheripper/Erlang-In-Docker >> >> -Rick >> >> > On Jun 18, 2015, at 6:18 AM, Marlus Saraiva >> wrote: >> > >> > Hi Stefan, >> > >> > In case you're looking for images with small footprints, give Alpine >> Linux a try. You can have a minimal Erlang image starting from 16.22MB. >> More info and examples can be found here: >> > https://github.com/msaraiva/docker-alpine >> > >> > Cheers, >> > -marlus >> > >> > 2015-06-18 3:10 GMT-03:00 Stefan Hellkvist : >> > Hi, >> > >> > Just out of curiosity, is anyone out there using Docker to deploy your >> Erlang releases? Any experiences captured in any blog out there? I am in >> particular interested in what docker images people are basing their >> deployments on. >> > >> > Personally I have used various Ubuntu images of varying sizes and also >> the phusion/baseimage (https://github.com/phusion/baseimage-docker) with >> good results but I would like to hear particularly if anyone has found any >> images with small footprints out there, capable of running Erlang releases >> (which is not a well defined requirement I guess, but still). >> > >> > Stefan >> > >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> > >> > _______________________________________________ >> > erlang-questions mailing list >> > erlang-questions@REDACTED >> > http://erlang.org/mailman/listinfo/erlang-questions >> >> > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- -=-=-=-=-=-=-=-=-=-=- http://blog.dloh.org/ -------------- next part -------------- An HTML attachment was scrubbed... URL: From rtrlists@REDACTED Mon Jun 22 16:06:17 2015 From: rtrlists@REDACTED (Robert Raschke) Date: Mon, 22 Jun 2015 15:06:17 +0100 Subject: [erlang-questions] question about cacertfiles option In-Reply-To: References: Message-ID: This is checking the cert from twilio, though. Right? So there's something in their ca chain, that ends up unknown. Or am I getting the wrong end of the stick. /Robby On Jun 22, 2015 10:05 AM, "Benoit Chesneau" wrote: > In hackney, by default the HTTPS connection is using the following > options: > > [{verify_fun, {fun ssl_verify_hostname:verify_fun/3, > [{check_hostname, Host}]}}, > {cacertfile, CACertFile }, > {server_name_indication, Host}, > {verify, verify_peer}, {depth, 99}, > {reuse_sessions, true}] > > Where the Host is based on the Url. CaCertFile is this one: > https://github.com/benoitc/hackney/blob/master/priv/ca-bundle.crt > > And the verify_fun is here: > https://github.com/deadtrickster/ssl_verify_hostname.erl/blob/master/src/ssl_verify_hostname.erl > > It works in most cases but when connecting to Twillio I get the following > error: > > 2> hackney:get("https://api.twilio.com/2010-04-01/Accounts/"). > > =ERROR REPORT==== 22-Jun-2015::10:46:28 === > SSL: certify: ssl_handshake.erl:1403:Fatal error: unknown ca > {error,{tls_alert,"unknown ca"}} > > When checking the CA files it seems it contains the thawte certificaes: > > $ cat priv/ca-bundle.crt|grep thawte > thawte Primary Root CA > thawte Primary Root CA - G2 > thawte Primary Root CA - G3 > > Before opening a ticket I was wondering if I missed something in my > configuration? Is there anything wrong in the CA file? Any option is > missing? > > - benoit > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.meadows.jonsson@REDACTED Mon Jun 22 16:47:35 2015 From: eric.meadows.jonsson@REDACTED (=?UTF-8?Q?Eric_Meadows=2DJ=C3=B6nsson?=) Date: Mon, 22 Jun 2015 16:47:35 +0200 Subject: [erlang-questions] question about cacertfiles option In-Reply-To: References: Message-ID: Erlang will always verify the certificate chain to the root. If an intermediate certificate is trusted but the root is not trusted the verification will fail. The partial_chain option can be used to terminate the verification at the first trusted certificate. On Mon, Jun 22, 2015 at 4:06 PM, Robert Raschke wrote: > This is checking the cert from twilio, though. Right? So there's something > in their ca chain, that ends up unknown. Or am I getting the wrong end of > the stick. > > /Robby > On Jun 22, 2015 10:05 AM, "Benoit Chesneau" wrote: > >> In hackney, by default the HTTPS connection is using the following >> options: >> >> [{verify_fun, {fun ssl_verify_hostname:verify_fun/3, >> [{check_hostname, Host}]}}, >> {cacertfile, CACertFile }, >> {server_name_indication, Host}, >> {verify, verify_peer}, {depth, 99}, >> {reuse_sessions, true}] >> >> Where the Host is based on the Url. CaCertFile is this one: >> https://github.com/benoitc/hackney/blob/master/priv/ca-bundle.crt >> >> And the verify_fun is here: >> https://github.com/deadtrickster/ssl_verify_hostname.erl/blob/master/src/ssl_verify_hostname.erl >> >> It works in most cases but when connecting to Twillio I get the following >> error: >> >> 2> hackney:get("https://api.twilio.com/2010-04-01/Accounts/"). >> >> =ERROR REPORT==== 22-Jun-2015::10:46:28 === >> SSL: certify: ssl_handshake.erl:1403:Fatal error: unknown ca >> {error,{tls_alert,"unknown ca"}} >> >> When checking the CA files it seems it contains the thawte certificaes: >> >> $ cat priv/ca-bundle.crt|grep thawte >> thawte Primary Root CA >> thawte Primary Root CA - G2 >> thawte Primary Root CA - G3 >> >> Before opening a ticket I was wondering if I missed something in my >> configuration? Is there anything wrong in the CA file? Any option is >> missing? >> >> - benoit >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Eric Meadows-J?nsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From chandrashekhar.mullaparthi@REDACTED Mon Jun 22 17:17:44 2015 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Mon, 22 Jun 2015 16:17:44 +0100 Subject: [erlang-questions] How to supervise multi workers In-Reply-To: References: Message-ID: Hi, I read your email and your blog post. What exactly is the problem you're trying to solve? Chandru On 22 June 2015 at 13:24, Phong Mai wrote: > Hi there, > > I?m trying to build my first Erlang OTP application but stuck at > supervising my workers. > My application has a central worker to get messages from RabbitMQ then, > depends on the messages, tasks will be distributed to poolboy worker to > process the task. I tried few methods but unable to make both supervisors > work. > > > http://damntechnology.blogspot.com/2011/10/erlang-supervising-two-processes-from.html > > Best Regards > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From guninalexander@REDACTED Tue Jun 23 12:04:57 2015 From: guninalexander@REDACTED (Alex Gunin) Date: Tue, 23 Jun 2015 13:04:57 +0300 Subject: [erlang-questions] Erlang RAFT consensus full implementation Message-ID: <245AE183-B79B-44B6-814B-7AEECCCA7D71@gmail.com> https://github.com/dreyk/zraft_lib Full Implementation Raft consensus protocol on Erlang Supported features: Runtime membership reconfiguration. Log truncation via snapshotting. Peer asynchronous RPC. Pluggable state machine. Optimistic log replication. Snapshot transfer via kernel sendfile command. Client sessions. Temporary data (like ephemeral nodes) Data change triggers. -------------- next part -------------- An HTML attachment was scrubbed... URL: From nem@REDACTED Tue Jun 23 22:12:59 2015 From: nem@REDACTED (Geoff Cant) Date: Tue, 23 Jun 2015 13:12:59 -0700 Subject: [erlang-questions] Erlang RAFT consensus full implementation In-Reply-To: <245AE183-B79B-44B6-814B-7AEECCCA7D71@gmail.com> References: <245AE183-B79B-44B6-814B-7AEECCCA7D71@gmail.com> Message-ID: Wow - this looks like a fantastic piece of work. I really appreciate that you took the time to include a diagram in the project readme too - that?s incredibly helpful to people looking into building on your work. Cheers, -Geoff > On Jun 23, 2015, at 03:04, Alex Gunin wrote: > > https://github.com/dreyk/zraft_lib > > Full Implementation Raft consensus protocol on Erlang > > Supported features: > > Runtime membership reconfiguration. > Log truncation via snapshotting. > Peer asynchronous RPC. > Pluggable state machine. > Optimistic log replication. > Snapshot transfer via kernel sendfile command. > Client sessions. > Temporary data (like ephemeral nodes) > Data change triggers. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth@REDACTED Wed Jun 24 13:50:00 2015 From: kenneth@REDACTED (Kenneth Lundin) Date: Wed, 24 Jun 2015 13:50:00 +0200 Subject: [erlang-questions] Erlang/OTP 18.0 has been released Message-ID: Erlang/OTP 18.0 has been released -------------------------------------------------- Erlang/OTP 18.0 is a new major release with new features, quite a few (characteristics) improvements, as well as some incompatibilities. A non functional but major change this release is the change of license to APL 2.0 (Apache Public License). Some highlights of the release are: - Starting from 18.0 Erlang/OTP is released under the APL 2.0 (Apache Public License) - erts: The time functionality has been extended. This includes a new API for time, as well as "time warp" modes which alters the behavior when system time changes. You are strongly encouraged to use the new API instead of the old API based on erlang:now/0. erlang:now/0 has been deprecated since it is a scalability bottleneck. For more information see the Time and Time Correction chapter of the ERTS User's Guide. Here is a link http://www.erlang.org/doc/apps/erts/time_correction.html - erts: Beside the API changes and time warp modes a lot of scalability and performance improvements regarding time management has been made. Examples are: - scheduler specific timer wheels, - scheduler specific BIF timer management, - parallel retrieval of monotonic time and system time on OS:es that support it. - erts: The previously introduced "eager check I/O" feature is now enabled by default. - erts/compiler: enhanced support for maps. Big maps new uses a HAMT (Hash Array Mapped Trie) representation internally which makes them more efficient. There is now also support for variables as map keys. - dialyzer: The -dialyzer() attribute can be used for suppressing warnings in a module by specifying functions or warning options. It can also be used for requesting warnings in a module. - ssl: Remove default support for SSL-3.0 and added padding check for TLS-1.0 due to the Poodle vulnerability. - ssl: Remove default support for RC4 cipher suites, as they are consider too weak. - stdlib: Allow maps for supervisor flags and child specs - stdlib: New functions in ets: - take/2. Works the same as ets:delete/2 but also returns the deleted object(s). - ets:update_counter/4 with a default object as argument You can find the Release Notes with more detailed info at http://www.erlang.org/download/otp_src_18.0.readme *IMPORTANT INFO when building your own code with this OTP release* Since erlang:now is deprecated your build might stop if you are using "warnings as errors". To let the build through you can turn of warnings for deprecated functions by setting an environment variable like this: export ERL_COMPILER_OPTIONS=nowarn_deprecated_function You find the source code at github.com in the official Erlang repository. Git tag OTP-18.0 https://github.com/erlang/otp/tree/OTP-18.0 You can also read the documentation on-line here: (see the Release Notes mentioned above for release notes which are not updated in the doc, but the new functionality is) http://www.erlang.org/doc/ We also want to thank those that sent us patches, suggestions and bug reports. The Erlang/OTP Team at Ericsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From Aleksander.Nycz@REDACTED Wed Jun 24 13:57:23 2015 From: Aleksander.Nycz@REDACTED (Aleksander Nycz) Date: Wed, 24 Jun 2015 13:57:23 +0200 Subject: [erlang-questions] Erlang/OTP 18.0 has been released In-Reply-To: References: Message-ID: <558A9B23.7020307@comarch.pl> Great job! Are you going to release OTP 17.6? Regards ANycz W dniu 2015-06-24 o 13:50, Kenneth Lundin pisze: > Erlang/OTP 18.0 has been released > -------------------------------------------------- > > Erlang/OTP 18.0 is a new major release with new features, quite a few > (characteristics) improvements, as well as some incompatibilities. > A non functional but major change this release is the change of > license to APL 2.0 (Apache Public License). > > Some highlights of the release are: > > * Starting from 18.0 Erlang/OTP is released under the APL 2.0 > (Apache Public License) > * erts: The time functionality has been extended. > This includes a new API for time, as well as "time warp" modes > which alters the behavior when system time changes. You are > strongly encouraged to use the new API instead of the old API > based on erlang:now/0. erlang:now/0 has been deprecated since it > is a scalability bottleneck. > For more information see the Time and Time Correction chapter of > the ERTS User's Guide. Here is a link > http://www.erlang.org/doc/apps/erts/time_correction.html > * erts: Beside the API changes and time warp modes a lot of > scalability and performance improvements regarding time management > has been made. Examples are: > o scheduler specific timer wheels, > o scheduler specific BIF timer management, > o parallel retrieval of monotonic time and system time on OS:es > that support it. > * erts: The previously introduced "eager check I/O" feature is now > enabled by default. > * erts/compiler: enhanced support for maps. Big maps new uses a HAMT > (Hash Array Mapped Trie) representation internally which makes > them more efficient. There is now also support for variables as > map keys. > * dialyzer: The -dialyzer() attribute can be used for suppressing > warnings > in a module by specifying functions or warning options. > It can also be used for requesting warnings in a module. > * ssl: Remove default support for SSL-3.0 and added padding check > for TLS-1.0 due to the Poodle vulnerability. > * ssl: Remove default support for RC4 cipher suites, as they are > consider too weak. > * stdlib: Allow maps for supervisor flags and child specs > * stdlib: New functions in ets: > o take/2. Works the same as ets:delete/2 but > also returns the deleted object(s). > o ets:update_counter/4 with a default object as > argument > > You can find the Release Notes with more detailed info at > > http://www.erlang.org/download/otp_src_18.0.readme > > *IMPORTANT INFO when building your own code with this OTP release > * > Since erlang:now is deprecated your build might stop if you are using > "warnings as errors". > To let the build through you can turn of warnings for deprecated functions > by setting an environment variable like this: > export ERL_COMPILER_OPTIONS=nowarn_deprecated_function > > > You find the source code at github.com in the > official Erlang repository. > > Git tag OTP-18.0 > > https://github.com/erlang/otp/tree/OTP-18.0 > > You can also read the documentation on-line here: > (see the Release Notes mentioned above for release notes which > are not updated in the doc, but the new functionality is) > > http://www.erlang.org/doc/ > > We also want to thank those that sent us patches, suggestions and bug > reports. > > The Erlang/OTP Team at Ericsson > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 4936 bytes Desc: Kryptograficzna sygnatura S/MIME URL: From henrik@REDACTED Wed Jun 24 14:02:50 2015 From: henrik@REDACTED (Henrik Nord) Date: Wed, 24 Jun 2015 14:02:50 +0200 Subject: [erlang-questions] Erlang/OTP 18.0 has been released In-Reply-To: <558A9B23.7020307@comarch.pl> References: <558A9B23.7020307@comarch.pl> Message-ID: <558A9C6A.8000206@erlang.org> On 2015-06-24 13:57, Aleksander Nycz wrote: > Great job! > > Are you going to release OTP 17.6? 17.5.6.1 in that case, and nothing planned yet. > > Regards > ANycz > > W dniu 2015-06-24 o 13:50, Kenneth Lundin pisze: >> Erlang/OTP 18.0 has been released >> -------------------------------------------------- >> >> Erlang/OTP 18.0 is a new major release with new features, quite a few >> (characteristics) improvements, as well as some incompatibilities. >> A non functional but major change this release is the change of >> license to APL 2.0 (Apache Public License). >> >> Some highlights of the release are: >> >> * Starting from 18.0 Erlang/OTP is released under the APL 2.0 >> (Apache Public License) >> * erts: The time functionality has been extended. >> This includes a new API for time, as well as "time warp" modes >> which alters the behavior when system time changes. You are >> strongly encouraged to use the new API instead of the old API >> based on erlang:now/0. erlang:now/0 has been deprecated since it >> is a scalability bottleneck. >> For more information see the Time and Time Correction chapter of >> the ERTS User's Guide. Here is a link >> http://www.erlang.org/doc/apps/erts/time_correction.html >> * erts: Beside the API changes and time warp modes a lot of >> scalability and performance improvements regarding time >> management has been made. Examples are: >> o scheduler specific timer wheels, >> o scheduler specific BIF timer management, >> o parallel retrieval of monotonic time and system time on OS:es >> that support it. >> * erts: The previously introduced "eager check I/O" feature is now >> enabled by default. >> * erts/compiler: enhanced support for maps. Big maps new uses a >> HAMT (Hash Array Mapped Trie) representation internally which >> makes them more efficient. There is now also support for >> variables as map keys. >> * dialyzer: The -dialyzer() attribute can be used for suppressing >> warnings >> in a module by specifying functions or warning options. >> It can also be used for requesting warnings in a module. >> * ssl: Remove default support for SSL-3.0 and added padding check >> for TLS-1.0 due to the Poodle vulnerability. >> * ssl: Remove default support for RC4 cipher suites, as they are >> consider too weak. >> * stdlib: Allow maps for supervisor flags and child specs >> * stdlib: New functions in ets: >> o take/2. Works the same as ets:delete/2 but >> also returns the deleted object(s). >> o ets:update_counter/4 with a default object as >> argument >> >> You can find the Release Notes with more detailed info at >> >> http://www.erlang.org/download/otp_src_18.0.readme >> >> *IMPORTANT INFO when building your own code with this OTP release >> * >> Since erlang:now is deprecated your build might stop if you are using >> "warnings as errors". >> To let the build through you can turn of warnings for deprecated >> functions >> by setting an environment variable like this: >> export ERL_COMPILER_OPTIONS=nowarn_deprecated_function >> >> >> You find the source code at github.com in the >> official Erlang repository. >> >> Git tag OTP-18.0 >> >> https://github.com/erlang/otp/tree/OTP-18.0 >> >> You can also read the documentation on-line here: >> (see the Release Notes mentioned above for release notes which >> are not updated in the doc, but the new functionality is) >> >> http://www.erlang.org/doc/ >> >> We also want to thank those that sent us patches, suggestions and bug >> reports. >> >> The Erlang/OTP Team at Ericsson >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Wed Jun 24 14:44:22 2015 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 24 Jun 2015 15:44:22 +0300 Subject: [erlang-questions] Erlang/OTP 18.0 has been released In-Reply-To: <558A9C6A.8000206@erlang.org> References: <558A9B23.7020307@comarch.pl> <558A9C6A.8000206@erlang.org> Message-ID: Very cool! Thanks a lot for your wonderful job! -------------- next part -------------- An HTML attachment was scrubbed... URL: From rory@REDACTED Wed Jun 24 14:48:17 2015 From: rory@REDACTED (Rory Byrne) Date: Wed, 24 Jun 2015 13:48:17 +0100 Subject: [erlang-questions] {error,closed} vs. {error,econnreset} In-Reply-To: References: <54E4A07E.5010307@erlang.org> <20150502103209.GA19880@nybek.com> Message-ID: <20150624124817.GA30126@nybek.com> Hi Andras, On Tue, May 05, 2015 at 07:44:47AM +0000, Bekes, Andras G wrote: > Thank you very much for your efforts Rory. > > The ability "to set a socket option that shows all econnreset errors" sounds like the right solution. I am wondering why hiding this detail is the default, but I believe there were good enough reasons to design it that way. > > I accept that your solution will not notice the connection reset event in some corner cases. I think this will not apply in my case: I am sending a small amount of data (<1KB) and wait for the reply. > > I am looking forward to see your patch in the next release of Erlang/OTP! The fix for this is in the 18.0 release. It should take care of the corner cases too. Use the socket option '{show_econnreset, true}' and you'll receive {error, econnreset} in passive mode or {tcp_error, Socket, econnreset} in active mode. See the docs [1] for more information. Regards, Rory [1] http://www.erlang.org/doc/man/inet.html#setopts-2 From vladdu55@REDACTED Wed Jun 24 15:31:42 2015 From: vladdu55@REDACTED (Vlad Dumitrescu) Date: Wed, 24 Jun 2015 15:31:42 +0200 Subject: [erlang-questions] Erlang/OTP 18.0 has been released In-Reply-To: References: Message-ID: Excellent! Congratulations! Please update the links to the downloadable files in the README file, all versions used in the file names are specified as "18" but should be "18.0". best regards, Vlad On Wed, Jun 24, 2015 at 1:50 PM, Kenneth Lundin wrote: > Erlang/OTP 18.0 has been released > -------------------------------------------------- > > Erlang/OTP 18.0 is a new major release with new features, quite a few > (characteristics) improvements, as well as some incompatibilities. > A non functional but major change this release is the change of license to > APL 2.0 (Apache Public License). > > Some highlights of the release are: > > > - Starting from 18.0 Erlang/OTP is released under the APL 2.0 (Apache > Public License) > - erts: The time functionality has been extended. > This includes a new API for time, as well as "time warp" modes which > alters the behavior when system time changes. You are strongly encouraged > to use the new API instead of the old API based on erlang:now/0. erlang:now/0 > has been deprecated since it is a scalability bottleneck. > For more information see the Time and Time Correction chapter of the > ERTS User's Guide. Here is a link > http://www.erlang.org/doc/apps/erts/time_correction.html > - erts: Beside the API changes and time warp modes a lot of > scalability and performance improvements regarding time management has been > made. Examples are: > - scheduler specific timer wheels, > - scheduler specific BIF timer management, > - parallel retrieval of monotonic time and system time on OS:es > that support it. > - erts: The previously introduced "eager check I/O" feature is now > enabled by default. > - erts/compiler: enhanced support for maps. Big maps new uses a HAMT > (Hash Array Mapped Trie) representation internally which makes them more > efficient. There is now also support for variables as map keys. > - dialyzer: The -dialyzer() attribute can be used for suppressing > warnings > in a module by specifying functions or warning options. > It can also be used for requesting warnings in a module. > - ssl: Remove default support for SSL-3.0 and added padding check for > TLS-1.0 due to the Poodle vulnerability. > - ssl: Remove default support for RC4 cipher suites, as they are > consider too weak. > - stdlib: Allow maps for supervisor flags and child specs > - stdlib: New functions in ets: > - take/2. Works the same as ets:delete/2 but > also returns the deleted object(s). > - ets:update_counter/4 with a default object as > argument > > You can find the Release Notes with more detailed info at > > http://www.erlang.org/download/otp_src_18.0.readme > > > > *IMPORTANT INFO when building your own code with this OTP release* > Since erlang:now is deprecated your build might stop if you are using > "warnings as errors". > To let the build through you can turn of warnings for deprecated functions > by setting an environment variable like this: > export ERL_COMPILER_OPTIONS=nowarn_deprecated_function > > > You find the source code at github.com in the official Erlang repository. > > Git tag OTP-18.0 > > https://github.com/erlang/otp/tree/OTP-18.0 > > You can also read the documentation on-line here: > (see the Release Notes mentioned above for release notes which > are not updated in the doc, but the new functionality is) > > http://www.erlang.org/doc/ > > We also want to thank those that sent us patches, suggestions and bug > reports. > > The Erlang/OTP Team at Ericsson > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From henrik@REDACTED Wed Jun 24 15:43:35 2015 From: henrik@REDACTED (Henrik Nord) Date: Wed, 24 Jun 2015 15:43:35 +0200 Subject: [erlang-questions] Erlang/OTP 18.0 has been released In-Reply-To: References: Message-ID: <558AB407.7000307@erlang.org> On 2015-06-24 15:31, Vlad Dumitrescu wrote: > Excellent! Congratulations! > > Please update the links to the downloadable files in the README file, > all versions used in the file names are specified as "18" but should > be "18.0". > fix > best regards, > Vlad > > > On Wed, Jun 24, 2015 at 1:50 PM, Kenneth Lundin > wrote: > > Erlang/OTP 18.0 has been released > -------------------------------------------------- > > Erlang/OTP 18.0 is a new major release with new features, quite a > few (characteristics) improvements, as well as some > incompatibilities. > A non functional but major change this release is the change of > license to APL 2.0 (Apache Public License). > > Some highlights of the release are: > > * Starting from 18.0 Erlang/OTP is released under the APL 2.0 > (Apache Public License) > * erts: The time functionality has been extended. > This includes a new API for time, as well as "time warp" modes > which alters the behavior when system time changes. You are > strongly encouraged to use the new API instead of the old API > based on erlang:now/0. erlang:now/0 has been deprecated since > it is a scalability bottleneck. > For more information see the Time and Time Correction chapter > of the ERTS User's Guide. Here is a link > http://www.erlang.org/doc/apps/erts/time_correction.html > * erts: Beside the API changes and time warp modes a lot of > scalability and performance improvements regarding time > management has been made. Examples are: > o scheduler specific timer wheels, > o scheduler specific BIF timer management, > o parallel retrieval of monotonic time and system time on > OS:es that support it. > * erts: The previously introduced "eager check I/O" feature is > now enabled by default. > * erts/compiler: enhanced support for maps. Big maps new uses a > HAMT (Hash Array Mapped Trie) representation internally which > makes them more efficient. There is now also support for > variables as map keys. > * dialyzer: The -dialyzer() attribute can be used for > suppressing warnings > in a module by specifying functions or warning options. > It can also be used for requesting warnings in a module. > * ssl: Remove default support for SSL-3.0 and added padding > check for TLS-1.0 due to the Poodle vulnerability. > * ssl: Remove default support for RC4 cipher suites, as they are > consider too weak. > * stdlib: Allow maps for supervisor flags and child specs > * stdlib: New functions in ets: > o take/2. Works the same as ets:delete/2 but > also returns the deleted object(s). > o ets:update_counter/4 with a default object as > argument > > You can find the Release Notes with more detailed info at > > http://www.erlang.org/download/otp_src_18.0.readme > > *IMPORTANT INFO when building your own code with this OTP release > * > Since erlang:now is deprecated your build might stop if you are using > "warnings as errors". > To let the build through you can turn of warnings for deprecated > functions > by setting an environment variable like this: > export ERL_COMPILER_OPTIONS=nowarn_deprecated_function > > > You find the source code at github.com in the > official Erlang repository. > > Git tag OTP-18.0 > > https://github.com/erlang/otp/tree/OTP-18.0 > > You can also read the documentation on-line here: > (see the Release Notes mentioned above for release notes which > are not updated in the doc, but the new functionality is) > > http://www.erlang.org/doc/ > > We also want to thank those that sent us patches, suggestions and > bug reports. > > The Erlang/OTP Team at Ericsson > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- /Henrik Nord Erlang/OTP -------------- next part -------------- An HTML attachment was scrubbed... URL: From ddosia@REDACTED Wed Jun 24 17:11:43 2015 From: ddosia@REDACTED (Daniil Churikov) Date: Wed, 24 Jun 2015 16:11:43 +0100 Subject: [erlang-questions] Looking for advice on simultaneous data modification In-Reply-To: References: Message-ID: Thanks, Benoit! Completely forgot about this wonderful library! 2015-06-19 17:10 GMT+01:00 Benoit Chesneau : > maybe locks could work for your case also? > > https://github.com/uwiger/locks > > - beno?t > > On Thu 18 Jun 2015 at 11:31 Daniil Churikov wrote: > >> Hi Robert. This possible that main-record deletion may be initiated in >> the same time from different processes, >> but it is highly unlikely. >> On a contrary, dependent-records will be added/modified/deleted in >> highly concurrent fashion. >> >> 2015-06-17 22:26 GMT+01:00 Robert Virding : >> >>> How do you mean "All the operations may happen in different processes >>> simultaneously."? Does it mean that many processes may initiate a record >>> deletion in parallel or does it mean that there maybe be parallel accesses >>> to the actual databases? >>> >>> Robert >>> >>> >>> On 17 June 2015 at 15:53, Daniil Churikov wrote: >>> >>>> Hello dear list. I am looking for advice to, perhaps, very common >>>> problem. >>>> >>>> I have database which does not support transactions, only CAS >>>> operations for single record. >>>> I have one-to-many relationship between 2 tables, and I need to >>>> implement cascade deletion of dependent records from table_2 when main >>>> record from table_1 was deleted. All the operations may happen in different >>>> processes simultaneously. >>>> So my intention is to do some kind of a mutex, which incorporate >>>> following properties: >>>> * when main record is in deletion-state, every other action on main >>>> and/or dependent record should wait until it will be deleted; >>>> * if main record is in normal-state, all dependencies may be modified >>>> without any strict order. >>>> >>>> Is there any library in the wild which allow me to do this kind of >>>> mutex? >>>> Maybe I have chosen wrong approach? Any suggestions? >>>> >>>> Thanks! >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Wed Jun 24 18:28:40 2015 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Wed, 24 Jun 2015 18:28:40 +0200 Subject: [erlang-questions] Erlang/OTP 18.0 has been released In-Reply-To: References: Message-ID: <558ADAB8.80104@ninenines.eu> Fantastic release! There's an impressive number of interesting things. My pet peeves are optimized time handling, timers and references; variables as keys in maps; optional callbacks; cached dialyzer native compiles; erlang:get_keys; ets stuff; zlib:inflateChunk; maps for supervisor specs; and the io_lib:scan_format functions. I am not sure what is meant by: OTP-10923 The Test Server application has been marked as obsolete and will be removed from OTP in the next major release (OTP 19.0). What's the replacement? Great job to everyone involved! Cheers, On 06/24/2015 01:50 PM, Kenneth Lundin wrote: > Erlang/OTP 18.0 has been released > -------------------------------------------------- > > Erlang/OTP 18.0 is a new major release with new features, quite a few > (characteristics) improvements, as well as some incompatibilities. > A non functional but major change this release is the change of license > to APL 2.0 (Apache Public License). > > Some highlights of the release are: > > * Starting from 18.0 Erlang/OTP is released under the APL 2.0 (Apache > Public License) > * erts: The time functionality has been extended. > This includes a new API for time, as well as "time warp" modes which > alters the behavior when system time changes. You are strongly > encouraged to use the new API instead of the old API based on > erlang:now/0. erlang:now/0 has been deprecated since it is a > scalability bottleneck. > For more information see the Time and Time Correction chapter of the > ERTS User's Guide. Here is a link > http://www.erlang.org/doc/apps/erts/time_correction.html > * erts: Beside the API changes and time warp modes a lot of > scalability and performance improvements regarding time management > has been made. Examples are: > o scheduler specific timer wheels, > o scheduler specific BIF timer management, > o parallel retrieval of monotonic time and system time on OS:es > that support it. > * erts: The previously introduced "eager check I/O" feature is now > enabled by default. > * erts/compiler: enhanced support for maps. Big maps new uses a HAMT > (Hash Array Mapped Trie) representation internally which makes them > more efficient. There is now also support for variables as map keys. > * dialyzer: The -dialyzer() attribute can be used for suppressing > warnings > in a module by specifying functions or warning options. > It can also be used for requesting warnings in a module. > * ssl: Remove default support for SSL-3.0 and added padding check for > TLS-1.0 due to the Poodle vulnerability. > * ssl: Remove default support for RC4 cipher suites, as they are > consider too weak. > * stdlib: Allow maps for supervisor flags and child specs > * stdlib: New functions in ets: > o take/2. Works the same as ets:delete/2 but > also returns the deleted object(s). > o ets:update_counter/4 with a default object as > argument > > You can find the Release Notes with more detailed info at > > http://www.erlang.org/download/otp_src_18.0.readme > > *IMPORTANT INFO when building your own code with this OTP release > * > Since erlang:now is deprecated your build might stop if you are using > "warnings as errors". > To let the build through you can turn of warnings for deprecated functions > by setting an environment variable like this: > export ERL_COMPILER_OPTIONS=nowarn_deprecated_function > > > You find the source code at github.com in the > official Erlang repository. > > Git tag OTP-18.0 > > https://github.com/erlang/otp/tree/OTP-18.0 > > You can also read the documentation on-line here: > (see the Release Notes mentioned above for release notes which > are not updated in the doc, but the new functionality is) > > http://www.erlang.org/doc/ > > We also want to thank those that sent us patches, suggestions and bug > reports. > > The Erlang/OTP Team at Ericsson > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From bchesneau@REDACTED Wed Jun 24 19:52:28 2015 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 24 Jun 2015 17:52:28 +0000 Subject: [erlang-questions] example of partial_chain in SSL Message-ID: Hi, I tried to use the partial_chain option in SSL to fix an unknown_ca issue but the function is never executed: The code is: enum_cacerts([], _Certs) -> unknown_ca; enum_cacerts([Cert| Rest], Certs) -> case lists:member(Cert, Certs) of true -> {trusted_ca, Cert}; false -> enum_cacerts(Rest, Certs) end. CACertFile = filename:join(hackney_util:privdir(), "ca-bundle.crt"), {ok, ServerCAs} = file:read_file(CACertFile), Pems = public_key:pem_decode(ServerCAs), CaCerts = lists:map(fun({_, Der, _}) -> Der end, Pems), PartialChain = fun(ChainCerts) -> enum_cacerts(CaCerts, ChainCerts) end, And the SSL options are: [{partial_chain, PartialChain}, {cacerts, CaCerts}, {server_name_indication, Host}, {verify_fun, {fun ssl_verify_hostname:verify_fun/3, [{check_hostname, Host}]}}, {verify, verify_peer}, {depth, 99}]; What am I doing wrong? I am not sure actually why the function is never executed. Any idea is welcome... - benoit -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony.m.esposito@REDACTED Thu Jun 25 00:50:30 2015 From: tony.m.esposito@REDACTED (Anthony Esposito) Date: Wed, 24 Jun 2015 22:50:30 +0000 Subject: [erlang-questions] [ANN] gold_fever - a treasure hunt for erlangers In-Reply-To: References: Message-ID: Fantastic, thanks for putting this out. I will use extensively in our Austin Erlang meetups. -tony On Tue, Jun 9, 2015 at 3:44 PM Fernando 'Brujo' Benavides < elbrujohalcon@REDACTED> wrote: > Hi all, > > Last Monday we had an Erlang-Dojo at Inaka?s offices. We played a game > written in Erlang that also required writing Erlang code to win (how cool > is that?!). > It?s a treasure hunt that starts when participants connect their own > Erlang nodes to the game server node and you can play it, too! > Check it out: http://github.com/inaka/gold_fever > Enjoy! > > [image: --] > Fernando "Brujo" Benavides > [image: http://]about.me/elbrujohalcon > > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- ======================================== Anthony Esposito github/twitter: tesp0 -------------- next part -------------- An HTML attachment was scrubbed... URL: From noah@REDACTED Wed Jun 24 23:05:46 2015 From: noah@REDACTED (Noah Treuhaft) Date: Wed, 24 Jun 2015 14:05:46 -0700 Subject: [erlang-questions] example of partial_chain in SSL Message-ID: > And the SSL options are: > > [{partial_chain, PartialChain}, > {cacerts, CaCerts}, > {server_name_indication, Host}, > {verify_fun, {fun ssl_verify_hostname:verify_fun/3, > [{check_hostname, Host}]}}, > {verify, verify_peer}, > {depth, 99}]; > > What am I doing wrong? I am not sure actually why the function is never > executed. Any idea is welcome... Your options don't include `{fail_if_no_peer_cert, true}`, so clients might be completing the handshake without sending a certificate. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bchesneau@REDACTED Thu Jun 25 09:24:53 2015 From: bchesneau@REDACTED (Benoit Chesneau) Date: Thu, 25 Jun 2015 07:24:53 +0000 Subject: [erlang-questions] example of partial_chain in SSL In-Reply-To: References: Message-ID: On Thu, Jun 25, 2015 at 6:34 AM Noah Treuhaft wrote: > > And the SSL options are: > > > > [{partial_chain, PartialChain}, > > {cacerts, CaCerts}, > > {server_name_indication, Host}, > > {verify_fun, {fun ssl_verify_hostname:verify_fun/3, > > [{check_hostname, Host}]}}, > > {verify, verify_peer}, > > {depth, 99}]; > > > > What am I doing wrong? I am not sure actually why the function is never > > > executed. Any idea is welcome... > > Your options don't include `{fail_if_no_peer_cert, true}`, so clients > might be completing the handshake without sending a certificate. > _ > Hrm thanks but adding this option doesn't change anything :/ The documentation is not really clear about it unfortunately :( - beno?t -------------- next part -------------- An HTML attachment was scrubbed... URL: From kenneth@REDACTED Thu Jun 25 12:23:43 2015 From: kenneth@REDACTED (Kenneth Lundin) Date: Thu, 25 Jun 2015 12:23:43 +0200 Subject: [erlang-questions] Erlang/OTP 18.0 has been released In-Reply-To: <558ADAB8.80104@ninenines.eu> References: <558ADAB8.80104@ninenines.eu> Message-ID: On Wed, Jun 24, 2015 at 6:28 PM, Lo?c Hoguin wrote: > Fantastic release! > > There's an impressive number of interesting things. My pet peeves are > optimized time handling, timers and references; variables as keys in maps; > optional callbacks; cached dialyzer native compiles; erlang:get_keys; ets > stuff; zlib:inflateChunk; maps for supervisor specs; and the > io_lib:scan_format functions. > > I am not sure what is meant by: > > OTP-10923 The Test Server application has been marked as obsolete and > will be removed from OTP in the next major release (OTP > 19.0). > There is a separate erlang application named test_server which is used by the common_test application. We don't think there are any use of the test_server APIs directly it is always used via common_test. What we plan to do is to move the test_server modules into the common_test application and remove them from the documentation. It will be internal APIs in common_test. By doing this it will be easier to make improvements in CommonTest without need to keep the test_server APIs and behaviour compatible. > > What's the replacement? > Everything is included in CommonTest, no need for test_server as a separate application. /Kenneth, Erlang/OTP Ericsson -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Thu Jun 25 13:05:25 2015 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Thu, 25 Jun 2015 13:05:25 +0200 Subject: [erlang-questions] Erlang/OTP 18.0 has been released In-Reply-To: References: <558ADAB8.80104@ninenines.eu> Message-ID: On Thu, Jun 25, 2015 at 12:23 PM, Kenneth Lundin wrote: > Everything is included in CommonTest, no need for test_server as a > separate application. Will 'ts' still be the tool (mod) to run otp.git tests? From nistrigunya@REDACTED Thu Jun 25 11:53:09 2015 From: nistrigunya@REDACTED (Avinash Dhumane) Date: Thu, 25 Jun 2015 15:23:09 +0530 Subject: [erlang-questions] Concurrent read and write in an ETS table Message-ID: I have an ETS table, where each object (in the table) is owned by a separate process; i.e. there is one-to-one relation between the object and its owner process. The object holds an externalized state which the process uses in the event of crash recovery. What options may I use, while instantiating the ETS table, in order to allow all these processes to concurrently access (read and write) their respective state? Would setting {write_concurrency, true} and {read_concurrency, true} suffice? Thanks Avinash -------------- next part -------------- An HTML attachment was scrubbed... URL: From ingela.andin@REDACTED Thu Jun 25 16:22:45 2015 From: ingela.andin@REDACTED (Ingela Andin) Date: Thu, 25 Jun 2015 16:22:45 +0200 Subject: [erlang-questions] example of partial_chain in SSL In-Reply-To: References: Message-ID: Hi! 2015-06-24 19:52 GMT+02:00 Benoit Chesneau : > Hi, > > I tried to use the partial_chain option in SSL to fix an unknown_ca issue > but the function is never executed: > > The partial chain function lets you shorten the certificate chain by accepting an intermediate cert sent to you by the peer as trusted. This is not the same as ignoring unknown_ca errors. If you want to handle incorrect clients (sending incomplete chains) by building the chain to the client certificate on the server side , if possible, you need to do that in the verify_fun when it fails and then call public_key:pkix_path_validation again with the chain that you built. Regards Ingela Erlang/OTP Team - Ericsson AB > The code is: > > enum_cacerts([], _Certs) -> > unknown_ca; > enum_cacerts([Cert| Rest], Certs) -> > case lists:member(Cert, Certs) of > true -> {trusted_ca, Cert}; > false -> enum_cacerts(Rest, Certs) > end. > > > CACertFile = filename:join(hackney_util:privdir(), > "ca-bundle.crt"), > {ok, ServerCAs} = file:read_file(CACertFile), > Pems = public_key:pem_decode(ServerCAs), > CaCerts = lists:map(fun({_, Der, _}) -> Der end, Pems), > > PartialChain = fun(ChainCerts) -> > enum_cacerts(CaCerts, ChainCerts) > end, > > And the SSL options are: > > [{partial_chain, PartialChain}, > {cacerts, CaCerts}, > {server_name_indication, Host}, > {verify_fun, {fun ssl_verify_hostname:verify_fun/3, > [{check_hostname, Host}]}}, > {verify, verify_peer}, > {depth, 99}]; > > What am I doing wrong? I am not sure actually why the function is never > executed. Any idea is welcome... > > - benoit > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From luis.rascao@REDACTED Thu Jun 25 16:35:48 2015 From: luis.rascao@REDACTED (=?UTF-8?B?THVpcyBSYXNjw6Nv?=) Date: Thu, 25 Jun 2015 15:35:48 +0100 Subject: [erlang-questions] Concurrent read and write in an ETS table In-Reply-To: References: Message-ID: Erlang's Factory 2014 video -- Eliminating Single Process Bottlenecks with ETS Concurrency Patterns might help you https://youtu.be/XrkY9WRY8p0 On Thu, Jun 25, 2015 at 10:53 AM, Avinash Dhumane wrote: > I have an ETS table, where each object (in the table) is owned by a > separate process; i.e. there is one-to-one relation between the object and > its owner process. The object holds an externalized state which the process > uses in the event of crash recovery. > > What options may I use, while instantiating the ETS table, in order to > allow all these processes to concurrently access (read and write) their > respective state? > > Would setting {write_concurrency, true} and {read_concurrency, true} > suffice? > > Thanks > Avinash > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- PGP fingerprint: F708 E141 AE8D 2D38 E1BC DF3D 1719 3EA0 647D 7260 -------------- next part -------------- An HTML attachment was scrubbed... URL: From sverker.eriksson@REDACTED Thu Jun 25 16:53:53 2015 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Thu, 25 Jun 2015 16:53:53 +0200 Subject: [erlang-questions] Concurrent read and write in an ETS table In-Reply-To: References: Message-ID: <558C1601.9010701@ericsson.com> I would think {write_concurrency, true} is best for your case. read_concurrency makes read ops even cheaper but makes switching between reading and writing more expensive. It will also increase the constant memory footprint of the table. /Sverker, Erlang/OTP On 06/25/2015 04:35 PM, Luis Rasc?o wrote: > Erlang's Factory 2014 video -- Eliminating Single Process Bottlenecks > with ETS Concurrency Patterns might help you > > https://youtu.be/XrkY9WRY8p0 > > On Thu, Jun 25, 2015 at 10:53 AM, Avinash Dhumane > > wrote: > > I have an ETS table, where each object (in the table) is owned by > a separate process; i.e. there is one-to-one relation between the > object and its owner process. The object holds an externalized > state which the process uses in the event of crash recovery. > > What options may I use, while instantiating the ETS table, in > order to allow all these processes to concurrently access (read > and write) their respective state? > > Would setting {write_concurrency, true} and {read_concurrency, > true} suffice? > > Thanks > Avinash > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > -- > PGP fingerprint: F708 E141 AE8D 2D38 E1BC DF3D 1719 3EA0 647D 7260 > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From 1172693953@REDACTED Thu Jun 25 17:25:41 2015 From: 1172693953@REDACTED (=?gb18030?B?ZHNkZHM=?=) Date: Thu, 25 Jun 2015 23:25:41 +0800 Subject: [erlang-questions] =?gb18030?q?about_rebar_generated_release_?= =?gb18030?q?=A1=A3Hint_already_use_node_name__when_I_use_=27gm=5Fserver_s?= =?gb18030?q?tart=27_startup?= Message-ID: Hi, everybody. First, Thank everyone help. I am using cowboy and rebar building a webapplication,the application running in ubuntu-server. I am start by shell that is succeed. but I uisng the releases of the rebar generated , use the 'gm_server start' is faild. oh,my god , excuse me, My broken English. I modified name of node?but ,still appeared the problem This error message below? -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: A29DB86B@REDACTED Type: application/octet-stream Size: 55689 bytes Desc: not available URL: From tuncer.ayaz@REDACTED Thu Jun 25 19:54:11 2015 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Thu, 25 Jun 2015 19:54:11 +0200 Subject: [erlang-questions] =?utf-8?q?about_rebar_generated_release_?= =?utf-8?q?=E3=80=82Hint_already_use_node_name_when_I_use_=27gm=5Fs?= =?utf-8?q?erver_start=27_startup?= In-Reply-To: References: Message-ID: Are you certain that you're not trying to start the release (node) twice? From mononcqc@REDACTED Thu Jun 25 19:57:33 2015 From: mononcqc@REDACTED (Fred Hebert) Date: Thu, 25 Jun 2015 13:57:33 -0400 Subject: [erlang-questions] =?utf-8?q?about_rebar_generated_release_?= =?utf-8?q?=E3=80=82Hint_already_use_node_name__when_I_use_=27gm=5Fserver_?= =?utf-8?q?start=27_startup?= In-Reply-To: References: Message-ID: <20150625175732.GB72759@ferdair.local> On 06/25, dsdds wrote: >Hi, everybody. First, Thank everyone help. > I am using cowboy and rebar building a webapplication,the application running in ubuntu-server. I am start by shell that is succeed. but I uisng the releases of the rebar generated , use the 'gm_server start' is faild. > oh,my god , excuse me, My broken English. > I modified name of node?but ,still appeared the problem > This error message below? Hi, the error you see is taking place because you start the node with the name 'gm_server@REDACTED' but another one with the same name exists. You just need to kill the old VM of the same name to run the new one. From chandrashekhar.mullaparthi@REDACTED Thu Jun 25 23:17:57 2015 From: chandrashekhar.mullaparthi@REDACTED (Chandru) Date: Thu, 25 Jun 2015 22:17:57 +0100 Subject: [erlang-questions] Concurrent read and write in an ETS table In-Reply-To: References: Message-ID: On 25 June 2015 at 10:53, Avinash Dhumane wrote: > I have an ETS table, where each object (in the table) is owned by a > separate process; i.e. there is one-to-one relation between the object and > its owner process. The object holds an externalized state which the process > uses in the event of crash recovery. > > What options may I use, while instantiating the ETS table, in order to > allow all these processes to concurrently access (read and write) their > respective state? > > Would setting {write_concurrency, true} and {read_concurrency, true} > suffice? > Yes, that should suffice. You may find this paper useful. http://www.researchgate.net/publication/262172496_On_the_scalability_of_the_Erlang_term_storage cheers Chandru -------------- next part -------------- An HTML attachment was scrubbed... URL: From jay@REDACTED Fri Jun 26 05:08:26 2015 From: jay@REDACTED (Jay Nelson) Date: Thu, 25 Jun 2015 20:08:26 -0700 Subject: [erlang-questions] Concurrent read and write in an ETS table Message-ID: <6E23BDA8-5C66-4270-B5A2-7558BEF3DC83@duomark.com> It is also important to carefully choose your keys so that the ets table is partitioned by process. The closer you can get to one process per row with distinct keys, the better your concurrent access. jay From 1172693953@REDACTED Fri Jun 26 04:07:58 2015 From: 1172693953@REDACTED (=?gb18030?B?ZHNkZHM=?=) Date: Fri, 26 Jun 2015 10:07:58 +0800 Subject: [erlang-questions] =?gb18030?b?u9i4tKO6ICBhYm91dCByZWIgYXIgZ2Vu?= =?gb18030?q?erated_release_=A1=A3Hint_already_use_nodename__when_I_use_?= =?gb18030?q?=27gm=5Fserver_start=27_startup?= In-Reply-To: <20150625175732.GB72759@ferdair.local> References: <20150625175732.GB72759@ferdair.local> Message-ID: I check the port and the process,but I have no found such as 'gm_server' process,I think may be my application start two times. I save some image about the error and the port of the os and process information,below. ------------------ ???? ------------------ ???: "Fred Hebert"; ????: 2015?6?26?(???) ??1:57 ???: "dsdds"<1172693953@REDACTED>; ??: "erlang-questions"; ??: Re: [erlang-questions] about reb ar generated release ?Hint already use nodename when I use 'gm_server start' startup On 06/25, dsdds wrote: >Hi, everybody. First, Thank everyone help. > I am using cowboy and rebar building a webapplication,the application running in ubuntu-server. I am start by shell that is succeed. but I uisng the releases of the rebar generated , use the 'gm_server start' is faild. > oh,my god , excuse me, My broken English. > I modified name of node?but ,still appeared the problem > This error message below? Hi, the error you see is taking place because you start the node with the name 'gm_server@REDACTED' but another one with the same name exists. You just need to kill the old VM of the same name to run the new one. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: DFF1CE4D@REDACTED Type: application/octet-stream Size: 56916 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 3A4F6674@REDACTED Type: application/octet-stream Size: 20659 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 7171A571@REDACTED Type: application/octet-stream Size: 44047 bytes Desc: not available URL: From max.lapshin@REDACTED Fri Jun 26 15:03:22 2015 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 26 Jun 2015 16:03:22 +0300 Subject: [erlang-questions] Erlang/OTP 18.0 has been released In-Reply-To: References: <558ADAB8.80104@ninenines.eu> Message-ID: Is the patch by Steve Vinosky included in this release? We still experience big problems with dirty schedulers on 17.4 in our ffmpeg needs. By the way, it seems to be very uneasy to enable runtime switch between dirty and non-dirty schedulers in NIF, because it requires expanding ERL_NIF_INIT macro. Is there any easy way to do it? -------------- next part -------------- An HTML attachment was scrubbed... URL: From mononcqc@REDACTED Fri Jun 26 15:17:03 2015 From: mononcqc@REDACTED (Fred Hebert) Date: Fri, 26 Jun 2015 09:17:03 -0400 Subject: [erlang-questions] =?utf-8?b?5Zue5aSN77yaICBhYm91dCByZWIgYXIgZ2Vu?= =?utf-8?q?erated_release_=E3=80=82Hint_already_use_nodename__when_I_use_?= =?utf-8?q?=27gm=5Fserver_start=27_startup?= In-Reply-To: References: <20150625175732.GB72759@ferdair.local> Message-ID: <20150626131702.GC72759@ferdair.local> On 06/26, dsdds wrote: >I check the port and the process,but I have no found such as 'gm_server' process,I think may be my application start two times. >I save some image about the error and the port of the os and process information,below. You run the following two commands: ./gm_server start ./gm_server console The first one will start the program in the background. Then if you want to connect to it, you have to runn an 'attach' command or something like 'erl -remsh gm_server@REDACTED -name debug'. By instead running './gm_server console', you're trying to boot the same exact node a second time, but with the terminal available rather than in the background. The problem is that the old node is still running in the background and their names then clash. That's the "protocol: ~tp: the name .... seems to be in use by another Erlang node" error. Regards, Fred. From olivier.boudeville@REDACTED Fri Jun 26 15:47:09 2015 From: olivier.boudeville@REDACTED (Olivier BOUDEVILLE) Date: Fri, 26 Jun 2015 15:47:09 +0200 Subject: [erlang-questions] A few type-related 18.0 questions Message-ID: Hi, Using 18.0, is there a way of specifying to Dialyzer that warnings about calls to non-existing functions should be suppressed by telling that from outside of the module that is supposed to define these functions? More precisely, in my case, a pseudo-module foobar is generated at runtime (compiled and loaded) with some functions (ex: baz/0), here from a test. When inspecting the BEAM of this test, as expected Dialyzer complains that there are calls to unknown function foobar:baz/0. As I have no BEAM for this generated foobar, I suppose I cannot suppress warnings from foobar. Typically in my test I would write '-dialyzer( { nowarn_function, foobar:baz/0 } ).' but I do not think that specifying "module-remote" functions is permitted? (the previous suppression triggers 'bad attribute' at compilation, because of the specification of the module, here foobar) A few other points: - random:ran/0 is mentioned in http://erlang.org/doc/man/random.html but does not seem to be exported; the same applies for file:mode/0 - previously built-in parametric types could be used, like in '-opaque hashtable( K, V ) :: tuple( bucket( K, V ) ).' or ' -opaque map_hashtable( K, V ) :: map( K, V ).'; it does not seem to be possible anymore, presumably in relation to OTP-11851? (ex: 'type tuple(_) undefined'). Finally, if generating the full PLT for Erlang itself, we have following warnings being issued: """ eunit_test.erl:305: Call to missing or unexported function eunit_test:nonexisting_function/0 xrc.erl:125: Call to missing or unexported function wxXmlResource:reload/2 Unknown functions: asn1rt_driver_handler:load_driver/0 megaco_ber__media_gateway_control_v1:info/0 wxWindows:'Destroy'/1 wx_core:quit/0 """ Maybe they could be fixed or suppressed? Thanks for any information, Best, Olivier. --------------------------- Olivier Boudeville EDF R&D : 1, avenue du G?n?ral de Gaulle, 92140 Clamart, France D?partement SINETICS, groupe ASICS (I2A), bureau B-226 Office : +33 1 47 65 59 58 / Mobile : +33 6 16 83 37 22 / Fax : +33 1 47 65 27 13 Ce message et toutes les pi?ces jointes (ci-apr?s le 'Message') sont ?tablis ? l'intention exclusive des destinataires et les informations qui y figurent sont strictement confidentielles. Toute utilisation de ce Message non conforme ? sa destination, toute diffusion ou toute publication totale ou partielle, est interdite sauf autorisation expresse. Si vous n'?tes pas le destinataire de ce Message, il vous est interdit de le copier, de le faire suivre, de le divulguer ou d'en utiliser tout ou partie. Si vous avez re?u ce Message par erreur, merci de le supprimer de votre syst?me, ainsi que toutes ses copies, et de n'en garder aucune trace sur quelque support que ce soit. Nous vous remercions ?galement d'en avertir imm?diatement l'exp?diteur par retour du message. Il est impossible de garantir que les communications par messagerie ?lectronique arrivent en temps utile, sont s?curis?es ou d?nu?es de toute erreur ou virus. ____________________________________________________ This message and any attachments (the 'Message') are intended solely for the addressees. The information contained in this Message is confidential. Any use of information contained in this Message not in accord with its purpose, any dissemination or disclosure, either whole or partial, is prohibited except formal approval. If you are not the addressee, you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return message. E-mail communication cannot be guaranteed to be timely secure, error or virus-free. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Fri Jun 26 18:00:39 2015 From: vinoski@REDACTED (Steve Vinoski) Date: Fri, 26 Jun 2015 12:00:39 -0400 Subject: [erlang-questions] Erlang/OTP 18.0 has been released In-Reply-To: References: <558ADAB8.80104@ninenines.eu> Message-ID: On Fri, Jun 26, 2015 at 9:03 AM, Max Lapshin wrote: > Is the patch by Steve Vinosky included in this release? > s/Vinosky/Vinoski/ We still experience big problems with dirty schedulers on 17.4 in our > ffmpeg needs. > My patch for the problem you saw (commit b7c9657) was never applied to 17.x, though it could be if the OTP team wanted to do that. But it is included in 18.0. Are you seeing similar problems with 18.0? > By the way, it seems to be very uneasy to enable runtime switch between > dirty and non-dirty schedulers in NIF, because it requires > expanding ERL_NIF_INIT macro. Is there any easy way to do it? > Dirty schedulers don't affect the ERL_NIF_INIT macro, but I think what you're referring to is the ErlNifFunc struct type, which was extended with an extra flags field for dirty schedulers (and perhaps other future uses). But you need not use that flags field to specify dirty scheduling -- you could instead specify in your ErlNifFunc a regular nif that schedules the call over to a dirty scheduler at runtime by checking enif_system_info, like this: ErlNifSysInfo si; enif_system_info(&si, sizeof(si)); if (si.dirty_scheduler_support) enif_schedule_nif(env, "dirty_nif", ERL_NIF_DIRTY_JOB_CPU_BOUND, dirty_nif, argc, argv); else /* run the function as a regular NIF or in your own thread pool */ This is slower than using the flags field, but the overhead is in the noise for typical applications. --steve -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Fri Jun 26 19:09:10 2015 From: max.lapshin@REDACTED (Max Lapshin) Date: Fri, 26 Jun 2015 20:09:10 +0300 Subject: [erlang-questions] Erlang/OTP 18.0 has been released In-Reply-To: References: <558ADAB8.80104@ninenines.eu> Message-ID: Steve, sorry for mispelling. I will try r18 asap and tell how it works. On Friday, June 26, 2015, Steve Vinoski wrote: > > > On Fri, Jun 26, 2015 at 9:03 AM, Max Lapshin > wrote: > >> Is the patch by Steve Vinosky included in this release? >> > > s/Vinosky/Vinoski/ > > We still experience big problems with dirty schedulers on 17.4 in our >> ffmpeg needs. >> > > My patch for the problem you saw (commit b7c9657) was never applied to > 17.x, though it could be if the OTP team wanted to do that. But it is > included in 18.0. Are you seeing similar problems with 18.0? > > >> By the way, it seems to be very uneasy to enable runtime switch between >> dirty and non-dirty schedulers in NIF, because it requires >> expanding ERL_NIF_INIT macro. Is there any easy way to do it? >> > > Dirty schedulers don't affect the ERL_NIF_INIT macro, but I think what > you're referring to is the ErlNifFunc struct type, which was extended with > an extra flags field for dirty schedulers (and perhaps other future uses). > But you need not use that flags field to specify dirty scheduling -- you > could instead specify in your ErlNifFunc a regular nif that schedules the > call over to a dirty scheduler at runtime by checking enif_system_info, > like this: > > ErlNifSysInfo si; > enif_system_info(&si, sizeof(si)); > if (si.dirty_scheduler_support) > enif_schedule_nif(env, "dirty_nif", ERL_NIF_DIRTY_JOB_CPU_BOUND, > dirty_nif, argc, argv); > else > /* run the function as a regular NIF or in your own thread pool */ > > This is slower than using the flags field, but the overhead is in the > noise for typical applications. > > --steve > -------------- next part -------------- An HTML attachment was scrubbed... URL: From 1172693953@REDACTED Fri Jun 26 15:26:49 2015 From: 1172693953@REDACTED (=?gb18030?B?ZHNkZHM=?=) Date: Fri, 26 Jun 2015 21:26:49 +0800 Subject: [erlang-questions] =?gb18030?b?u9i4tKO6ICBhYm91dCByZWIgYXIgZ2Vu?= =?gb18030?q?erated_release_=A1=A3Hint_already_use_nodename__when_I_use_?= =?gb18030?q?=27gm=5Fserver_start=27_startup?= In-Reply-To: <20150626131702.GC72759@ferdair.local> References: <20150625175732.GB72759@ferdair.local> <20150626131702.GC72759@ferdair.local> Message-ID: oh my god , Thank you very much. I have struggled for three days. thank you. ------------------ Original ------------------ From: "Fred Hebert"; Date: 2015?6?26?(???) ??9:17 To: "dsdds"<1172693953@REDACTED>; Cc: "erlang-questions"; Subject: Re: ??? [erlang-questions] about reb ar generated release ?Hint already use nodename when I use 'gm_server start' startup On 06/26, dsdds wrote: >I check the port and the process,but I have no found such as 'gm_server' process,I think may be my application start two times. >I save some image about the error and the port of the os and process information,below. You run the following two commands: ./gm_server start ./gm_server console The first one will start the program in the background. Then if you want to connect to it, you have to runn an 'attach' command or something like 'erl -remsh gm_server@REDACTED -name debug'. By instead running './gm_server console', you're trying to boot the same exact node a second time, but with the terminal available rather than in the background. The problem is that the old node is still running in the background and their names then clash. That's the "protocol: ~tp: the name .... seems to be in use by another Erlang node" error. Regards, Fred. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mremond@REDACTED Fri Jun 26 16:08:02 2015 From: mremond@REDACTED (=?utf-8?b?TWlja2HDq2wgUsOpbW9uZA==?=) Date: Fri, 26 Jun 2015 16:08:02 +0200 Subject: [erlang-questions] [ANN] ejabberd 15.06 Message-ID: <11B7D88B-437D-4084-877B-BC7E43CC7EB6@process-one.net> Hello, We are very proud of our new release of ejabberd with a lot of changes and improvements across the board. We now have message archiving built into ejabberd, with multiple backends. But we also put a lot of effort toward ease of use. That's why we introduce our new configuration file checker. For the same goal of ease of use, we are now packaging ejabberd under multiple forms: Binary installer, RPM and DEB packages and Windows (yes !) installer. As we do not want to interfere with Erlang installed on the system, our packages come with a minimal version of Erlang. The details of the 100+ changes since 15.03 are on our blog: https://blog.process-one.net/ejabberd-15-06/ Have fun ! -- Micka?l R?mond From nistrigunya@REDACTED Fri Jun 26 17:51:51 2015 From: nistrigunya@REDACTED (Avinash Dhumane) Date: Fri, 26 Jun 2015 21:21:51 +0530 Subject: [erlang-questions] Module-Function-Arguments (MFA) Message-ID: I need to implement a "service" functionality which allows the "client" to implement callbacks (from service into client's module) which it wishes to handle. I accept the module name as parameter from the client and mandate the function names (callbacks) and parameters thereof which the client may define in its module. Suppose one of the callback names is 'handle_tick', and the module name supplied by the client is held in variable 'Module' in my service implementation code. How do I verify whether client has implemented the function handle_tick() in its module? Or, do I just invoke it and handle the exception using try-catch? Thanks Avinash PS: I observe that the web sockets functionality in Yaws uses similar mechanism to invoke callbacks in client's module. But, digging into Yaws' source code is a little too overwhelming for me :-( -------------- next part -------------- An HTML attachment was scrubbed... URL: From seancribbs@REDACTED Fri Jun 26 19:48:16 2015 From: seancribbs@REDACTED (Sean Cribbs) Date: Fri, 26 Jun 2015 12:48:16 -0500 Subject: [erlang-questions] Module-Function-Arguments (MFA) In-Reply-To: References: Message-ID: You should create a behavior module that defines the callbacks, which act like -spec entries for the module that implements it. %%---------------------- %% The "service" module. -module(some_service). %% Replace this with whatever argument and return types are needed. -callback handle_tick() -> ok. %% This module will probably also contain other things that you use to drive the behavior of the client module. %%------------------------- %% The "client" module -module(some_client). -behaviour(some_service). %% This will force a check at compile-time that the module implements the callbacks. -export([handle_tick/0]). %% Replace with the proper implementation and type spec. -spec handle_tick() -> ok. handle_tick() -> ok. On Fri, Jun 26, 2015 at 10:51 AM, Avinash Dhumane wrote: > I need to implement a "service" functionality which allows the "client" to > implement callbacks (from service into client's module) which it wishes to > handle. > > I accept the module name as parameter from the client and mandate the > function names (callbacks) and parameters thereof which the client may > define in its module. > > Suppose one of the callback names is 'handle_tick', and the module name > supplied by the client is held in variable 'Module' in my service > implementation code. > > How do I verify whether client has implemented the function handle_tick() > in its module? Or, do I just invoke it and handle the exception using > try-catch? > > Thanks > Avinash > > PS: I observe that the web sockets functionality in Yaws uses similar > mechanism to invoke callbacks in client's module. But, digging into Yaws' > source code is a little too overwhelming for me :-( > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From tuncer.ayaz@REDACTED Fri Jun 26 23:42:18 2015 From: tuncer.ayaz@REDACTED (Tuncer Ayaz) Date: Fri, 26 Jun 2015 23:42:18 +0200 Subject: [erlang-questions] A few type-related 18.0 questions In-Reply-To: References: Message-ID: On Fri, Jun 26, 2015 at 3:47 PM, Olivier BOUDEVILLE wrote: > Hi, > > Using 18.0, is there a way of specifying to Dialyzer that warnings > about calls to non-existing functions should be suppressed by > telling that from outside of the module that is supposed to define > these functions? Yes, Hans Bolinder was kind enough to add it on short notice during the 18.0 cycle. We use it in rebar, which has to work on anything from R13B03 to 18.0. https://github.com/rebar/rebar/blob/6cc18c931c/src/rebar_utils.erl#L75: -dialyzer({no_missing_calls, escript_foldl/3}). This tells Dialyzer to ignore calls to unknown functions when analyzing escript_foldl/3. Does this work for you? From seancribbs@REDACTED Sat Jun 27 03:30:01 2015 From: seancribbs@REDACTED (Sean Cribbs) Date: Fri, 26 Jun 2015 20:30:01 -0500 Subject: [erlang-questions] 3rd Workshop on Planetary Scale Distributed Systems (CFP extended) Message-ID: Third Workshop on Planetary-Scale Distributed Systems, W-PSDS 2015 Second call for papers * Call for Papers Distributed systems have gained a more prominent role in the everyday life of many people. Additionally, the scale of these systems has also been increasing over the past decade, and systems that interconnect users at a planetary scale are now common place. Users expect these systems to be robust, highly available, safe, and efficient. This leads to the emergence of significative challenges for the scientific community to find solutions that provide all these characteristics. The goal of the workshop is to bring researchers and practitioners from the large-scale distributed systems communities to discuss the current state of the art, emerging challenges and trends, as well as novel solutions, implementation and deployment of large scale, and in particular of planetary-scale, distributed systems and applications. The workshop is looking for submissions in the form of papers with no more than 6 pages describing novel contributions and results as well as experiments reports. Th! e organization welcomes contributions from both academia and industry. Industry submission (or submissions with co-authors from industry) should be labelled as so for notifying reviewers. All submissions will be reviewed by members of the workshop program committee, that will select the best submissions for presentation at the workshop. Regular papers will appear at the workshop proceedings published in conjunction with the proceedings of SRDS. This workshop has the scientific sponsorship of the SyncFree European research project (funded through the European Union under the grant agreement 609551). More information in https://syncfree.lip6.fr. * Areas of Interest * Novel storage organizations for large scale systems (e.g., NoSQL databases, in-memory databases, geo-replicated systems) * Consistency, reliability, and fault models for large scale distributed systems * Data recovery: online and disaster recovery * System assumptions for dependability and performance * Scaling-out and elasticity with large number of nodes * Fully decentralized versus central control architectures * Robust and efficient protocols for unstructured overlay networks (epidemic-based dissemination, aggregation, slicing) * Peer-to-Peer systems, protocols, and applications * Large-scale infrastructure technologies (locking, group membership services) * Cloud computing * Grid Computing * Smart Grids * Security and privacy for planetary-scale distributed systems * Submission Guidelines Papers must be written in English. The workshop is looking for submissions in the form of papers with no more than 6 pages describing novel contributions and results as well as experiments reports, strictly following the IEEE two-column format. All submissions will be reviewed by members of the workshop program committee, that will select the best submissions for presentation at the workshop. Papers will appear at the workshop proceedings published in conjunction with the proceedings of SRDS. All paper submissions will be handled via Easychair ( https://www.easychair.org/conferences/?conf=wpsds2015). * Important Dates Paper submission: ** July 3, 2015 (extended) ** Authors notification: July 16, 2015 Camera-ready: July 26, 2015 Workshop: September 28, 2015 * Program Committee Jo?o Leit?o, NOVA University of Lisbon (Co-Chair) Ricardo Vila?a, Minho University (Co-Chair) Paulo Jesus, Oracle Jason Brown, Apache Cassandra Committer Jordan West, NOVA LINCS Nuno Pregui?a, NOVA University of Lisbon Carlos Baquero, University of Minho Alysson Bessani, University of Lisbon Fernando Pedone, University of Lugano Marek Zawirski, Google Bernard Wong, University of Waterloo Laura Ricci, University of Pisa Christopher Meiklejohn, Basho Technologies Marc Shapiro, LIP6 Etienne Revi?re, University of Neuch??tel Sean Cribbs, Comcast Miguel Matos, INESC TEC Ricardo Dias, INESC-ID * Venue The Workshop on Planetary-Scale Distributed Systems will take place on September 28, 2015, in Montreal, Canada, and is co-located with the SRDS 2015 conference. The goal of the workshop is to bring researchers and practitioners from the large-scale distributed systems communities to discuss the current state of the art, emerging challenges and trends, as well as novel solutions, implementation and deployment of large scale, and in particular of planetary-scale, distributed systems and applications. The Call for Papers for W-PSDS 2015 is available, please consider submitting your work. For further information please send an email to wpsds@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From bog495@REDACTED Sat Jun 27 10:58:39 2015 From: bog495@REDACTED (Bogdan Andu) Date: Sat, 27 Jun 2015 11:58:39 +0300 Subject: [erlang-questions] configure http methods in yaws In-Reply-To: References: Message-ID: Hi, About yaws as reverse proxy.. I want to use yaws as a reverse proxy in a http -> http setup. no ssl involved whatsoever. I am interested in interception module where I want to apply various checks on headers, query string, etc making this some kind of www firewall . Is this feature of yaws production ready ? Thanks, Bogdan On Fri, Feb 13, 2015 at 6:14 PM, Steve Vinoski wrote: > I don't recall seeing Yaws users asking for this config feature in the > past, so it's unlikely we'll add it. But what you're asking for -- a > configuration point for methods -- would be implemented much as I've shown > in my previous emails, much like a dispatchmod. The dispatchmod is as early > in the request handling process as you can get after the formation of the > #arg{}. The dispatchmod code I provided requires less configuration than > what you're showing, even for the default case, plus if having to have a > new module concerns you, the dispatch/1 function can be added to some other > existing module you already have instead. > > --steve > > > > On Fri, Feb 13, 2015 at 4:30 AM, Bogdan Andu wrote: > >> Yes but the point is to have a default configuration that can be >> overridden by such a mechanism >> if one is configured. >> The 99 percent of cases only need a default behaviour. >> >> The way I see this is to have something like that (all in one): >> >> >> mod_405=my_405_handle_module >> .... >> >> >> in this way we can also customize the response if a method other than GET >> or POST is sent to the server >> >> On Fri, Feb 13, 2015 at 10:17 AM, Imants Cekusins >> wrote: >> >>> > Traffic with methods not allowed should be discarded with 405 >>> >>> you see, someone else might prefer another action depending on method >>> not allowed. >>> >>> a dedicated attribute may be convenient but then someone would ask: >>> "how do I change the response code? how do I redirect?". Current >>> approach gives you choice. >>> >>> one of those cases when there is more than one approach, a prefers A, >>> b prefers B. Both have a valid point. >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From a.shneyderman@REDACTED Sat Jun 27 11:31:13 2015 From: a.shneyderman@REDACTED (Alex Shneyderman) Date: Sat, 27 Jun 2015 05:31:13 -0400 Subject: [erlang-questions] is there rr() finctionality outside of shell? Message-ID: Hi, all! I would like to nicely format dbg output. I have a formatter function but io:format() out of there produces plain tuples. Even if I am running this dbg:tc() code within the shell that saw rr() call beforehand. Is there a lib some place that helps with formatting records nicely, besides trying to dig it out the shell code? Cheers, Alex. From bchesneau@REDACTED Sat Jun 27 11:38:40 2015 From: bchesneau@REDACTED (Benoit Chesneau) Date: Sat, 27 Jun 2015 09:38:40 +0000 Subject: [erlang-questions] example of partial_chain in SSL In-Reply-To: References: Message-ID: Ingela, So it's not clear yet if the it was t-is the exact error here. It have been fixed by updating the list of PEM in the file in hackney using apple certificates store. The error I am referring has been reported here: https://github.com/benoitc/hackney/issues/196 So it is probably that apple is including an intermediate certificate that is not in the list provided by Mozilla. To be sure to understand, when a peer is not trusted by the validation function, will the partial_chain function still be executed? What is the order? I thought the partial_chain function would be executed first returning one of the certificate in the chain? In that case why it's not executed in the code snippet above? (i can provide you a full branch if it helps) More generally what is the common pattern in that case if any? - benoit On Thu, Jun 25, 2015 at 4:22 PM Ingela Andin wrote: > Hi! > > 2015-06-24 19:52 GMT+02:00 Benoit Chesneau : > >> Hi, >> >> I tried to use the partial_chain option in SSL to fix an unknown_ca issue >> but the function is never executed: >> >> > > The partial chain function lets you shorten the certificate chain by > accepting an intermediate cert sent to you by the peer as trusted. This is > not the same as ignoring unknown_ca errors. > If you want to handle incorrect clients (sending incomplete chains) by > building the chain to the client certificate on the server side , if > possible, you need to do that in the verify_fun when it fails and then call > public_key:pkix_path_validation again with the chain that you built. > > > Regards Ingela Erlang/OTP Team - Ericsson AB > > > >> The code is: >> >> enum_cacerts([], _Certs) -> >> unknown_ca; >> enum_cacerts([Cert| Rest], Certs) -> >> case lists:member(Cert, Certs) of >> true -> {trusted_ca, Cert}; >> false -> enum_cacerts(Rest, Certs) >> end. >> >> >> CACertFile = filename:join(hackney_util:privdir(), >> "ca-bundle.crt"), >> {ok, ServerCAs} = file:read_file(CACertFile), >> Pems = public_key:pem_decode(ServerCAs), >> CaCerts = lists:map(fun({_, Der, _}) -> Der end, Pems), >> >> PartialChain = fun(ChainCerts) -> >> enum_cacerts(CaCerts, ChainCerts) >> end, >> >> And the SSL options are: >> >> [{partial_chain, PartialChain}, >> {cacerts, CaCerts}, >> {server_name_indication, Host}, >> {verify_fun, {fun ssl_verify_hostname:verify_fun/3, >> [{check_hostname, Host}]}}, >> {verify, verify_peer}, >> {depth, 99}]; >> >> What am I doing wrong? I am not sure actually why the function is never >> executed. Any idea is welcome... >> >> - benoit >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From nathaniel@REDACTED Sat Jun 27 20:29:48 2015 From: nathaniel@REDACTED (Nathaniel Waisbrot) Date: Sat, 27 Jun 2015 14:29:48 -0400 Subject: [erlang-questions] Keeping the break handler for escripts Message-ID: When running an escript on a Unix system, interrupting with control-c leaved the terminal in a messy state (mostly that newlines don't trigger line-feeds). This is most visible when using Rebar with the "shell" command. (https://github.com/rebar/rebar3/issues/536) Looking at the Erlang source code, I saw that the immediate cause of this is a line in escript.c ( https://github.com/erlang/otp/blob/maint-17/erts/etc/common/escript.c#L458) that adds the "+B" emulator flag to all escript runs. "+B" (equivalent to "+Bd") disables the interrupt handler, which is both responsible for bringing up the "BREAK: (a)bort (c)ontinue..." menu, as well as for calling sys_tty_reset to put the TTY back the way it was before erl started. So my first question is, is the "+B" flag needed on escripts at all? It seems to me that between screwing up the TTY or popping up a useless menu (useless because we might be in a shell pipeline and unable to respond to the prompt), the menu is the better option. Are there things that would actually be broken by removing "+B"? Second, if "+B" can't be removed, would it be reasonable to make "+B" reset the TTY without showing the menu? Essentially have two break handlers, and "+B" would get you the lesser handler, rather than none at all. Finally, if that's also a bad option, what about providing a "+Be" flag to re-enable the disabled break handler? So escripts that knew that they were going to be long-running or user-interactive could specify +Be on their emulator arguments to undo the +B default. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Sun Jun 28 03:51:26 2015 From: vinoski@REDACTED (Steve Vinoski) Date: Sat, 27 Jun 2015 21:51:26 -0400 Subject: [erlang-questions] configure http methods in yaws In-Reply-To: References: Message-ID: On Sat, Jun 27, 2015 at 4:58 AM, Bogdan Andu wrote: > Hi, > > About yaws as reverse proxy.. > > I want to use yaws as a reverse proxy in a > http -> http setup. no ssl involved whatsoever. > > I am interested in interception module where I want > to apply various checks on headers, query string, etc > making this some kind of www firewall . > > Is this feature of yaws production ready ? > Yes. You can find details about it in chapter 13 of http://yaws.hyber.org/yaws.pdf, or under the revproxy section of http://yaws.hyber.org/yman.yaws?page=yaws.conf . --steve > > > Thanks, > Bogdan > > > On Fri, Feb 13, 2015 at 6:14 PM, Steve Vinoski wrote: > >> I don't recall seeing Yaws users asking for this config feature in the >> past, so it's unlikely we'll add it. But what you're asking for -- a >> configuration point for methods -- would be implemented much as I've shown >> in my previous emails, much like a dispatchmod. The dispatchmod is as early >> in the request handling process as you can get after the formation of the >> #arg{}. The dispatchmod code I provided requires less configuration than >> what you're showing, even for the default case, plus if having to have a >> new module concerns you, the dispatch/1 function can be added to some other >> existing module you already have instead. >> >> --steve >> >> >> >> On Fri, Feb 13, 2015 at 4:30 AM, Bogdan Andu wrote: >> >>> Yes but the point is to have a default configuration that can be >>> overridden by such a mechanism >>> if one is configured. >>> The 99 percent of cases only need a default behaviour. >>> >>> The way I see this is to have something like that (all in one): >>> >>> >>> mod_405=my_405_handle_module >>> .... >>> >>> >>> in this way we can also customize the response if a method other than >>> GET or POST is sent to the server >>> >>> On Fri, Feb 13, 2015 at 10:17 AM, Imants Cekusins >>> wrote: >>> >>>> > Traffic with methods not allowed should be discarded with 405 >>>> >>>> you see, someone else might prefer another action depending on method >>>> not allowed. >>>> >>>> a dedicated attribute may be convenient but then someone would ask: >>>> "how do I change the response code? how do I redirect?". Current >>>> approach gives you choice. >>>> >>>> one of those cases when there is more than one approach, a prefers A, >>>> b prefers B. Both have a valid point. >>>> >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bog495@REDACTED Sun Jun 28 17:20:47 2015 From: bog495@REDACTED (Bogdan Andu) Date: Sun, 28 Jun 2015 18:20:47 +0300 Subject: [erlang-questions] configure http methods in yaws In-Reply-To: References: Message-ID: Hi, I know the docs and I run internally Yaws in reverse proxy mode and I want this in Internet facing setup also I searched the net 'yaws reverse proxy' and I found: 1) http://stackoverflow.com/questions/917546/has-anybody-used-yaws-server-as-an-http-proxy although 6 years old, is Yaws in reverse proxy mode comparable or even better than varnis, haproxy, nginx? 2) http://osdir.com/ml/web.server.yaws.general/2007-12/msg00000.html this one is from klacke and he speaks about difficulties he encountered writing revproxy engine.as well as an OTP limitation being the main obstacle in overcoming these. Are these still apply today? 3) also found this: http://www.erlang-factory.com/upload/presentations/752/reed-efsf2013-whatsapp.pdf it seems whatsapp useses or used yaws in revproxy mode with some tweaks The setup I want is simple: Because I have the applications written in other language and for rewriting them in Erlang I dont have the time I must use this setup: - Yaws in front-end in revproxy mode with interception module with plenty of check on headers, cookies, etc - Twiggy/Starlet/Starman as back-end or psgi server more info here: http://www.slideshare.net/kazeburo/yapc2013psgi-plack I want to keepalive connections between yaws and psgi servers to avoid 3-way handshake overhead. Although with outside world I want disable keepalive and set 'connection: close' and all of thiese can be done by altering the headers tru interception module. Is it safe to keepalive connections between Yaws and Twiggy for example which is an Libevent implementation web server? Or Starlet/Starman like web server which has a parallel pre-fork model? Thanks and sorry for long post, Bogdan On Sun, Jun 28, 2015 at 4:51 AM, Steve Vinoski wrote: > > > On Sat, Jun 27, 2015 at 4:58 AM, Bogdan Andu wrote: > >> Hi, >> >> About yaws as reverse proxy.. >> >> I want to use yaws as a reverse proxy in a >> http -> http setup. no ssl involved whatsoever. >> >> I am interested in interception module where I want >> to apply various checks on headers, query string, etc >> making this some kind of www firewall . >> >> Is this feature of yaws production ready ? >> > > Yes. You can find details about it in chapter 13 of > http://yaws.hyber.org/yaws.pdf, or under the revproxy section of > http://yaws.hyber.org/yman.yaws?page=yaws.conf . > > --steve > > > >> >> >> Thanks, >> Bogdan >> >> >> On Fri, Feb 13, 2015 at 6:14 PM, Steve Vinoski wrote: >> >>> I don't recall seeing Yaws users asking for this config feature in the >>> past, so it's unlikely we'll add it. But what you're asking for -- a >>> configuration point for methods -- would be implemented much as I've shown >>> in my previous emails, much like a dispatchmod. The dispatchmod is as early >>> in the request handling process as you can get after the formation of the >>> #arg{}. The dispatchmod code I provided requires less configuration than >>> what you're showing, even for the default case, plus if having to have a >>> new module concerns you, the dispatch/1 function can be added to some other >>> existing module you already have instead. >>> >>> --steve >>> >>> >>> >>> On Fri, Feb 13, 2015 at 4:30 AM, Bogdan Andu wrote: >>> >>>> Yes but the point is to have a default configuration that can be >>>> overridden by such a mechanism >>>> if one is configured. >>>> The 99 percent of cases only need a default behaviour. >>>> >>>> The way I see this is to have something like that (all in one): >>>> >>>> >>>> mod_405=my_405_handle_module >>>> .... >>>> >>>> >>>> in this way we can also customize the response if a method other than >>>> GET or POST is sent to the server >>>> >>>> On Fri, Feb 13, 2015 at 10:17 AM, Imants Cekusins >>>> wrote: >>>> >>>>> > Traffic with methods not allowed should be discarded with 405 >>>>> >>>>> you see, someone else might prefer another action depending on method >>>>> not allowed. >>>>> >>>>> a dedicated attribute may be convenient but then someone would ask: >>>>> "how do I change the response code? how do I redirect?". Current >>>>> approach gives you choice. >>>>> >>>>> one of those cases when there is more than one approach, a prefers A, >>>>> b prefers B. Both have a valid point. >>>>> >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From benhsu@REDACTED Sun Jun 28 20:55:56 2015 From: benhsu@REDACTED (Ben Hsu) Date: Sun, 28 Jun 2015 14:55:56 -0400 Subject: [erlang-questions] trying to learn cowboy Message-ID: Hello Erlangers I am going through some basic steps learning cowboy, and I'm doing something wrong, but I can't figure it out. In the code below, I'm pattern matching against cowboy_req:method(Req), and it _should_ be returning {'GET', _}, which takes me to the first branch of the case statement. But it keeps executing the default case. I printed out what cowboy_req:method is returning, and it looks like GET, In the spirit of shotgun-debugging this I've tried matching against 'GET', "GET", <<'GET'>>, and <<"GET">>, none of which work I'm sure there is something simple I am missing here. What is it? Thank you for your time and patience :) handle(Req, State) -> Reply = case cowboy_req:method(Req) of {'GET', _} -> % this is never executed when I do a curl-GET against my app SomeMsg = "some message", {ok, Req2} = cowboy_req:reply(200, [{<<"content-type">>, <<"text/plain">>}], SomeMsg, Req), {ok, Req2, State}; _ -> % even though i am printing out what cowboy_req:method returns here and it says GET {FNORD, _} = cowboy_req:method(Req), {ok, R} = cowboy_req:reply(200, [], FNORD, Req), R end, {ok, Reply, State}. -------------- next part -------------- An HTML attachment was scrubbed... URL: From benhsu@REDACTED Sun Jun 28 21:05:47 2015 From: benhsu@REDACTED (Ben Hsu) Date: Sun, 28 Jun 2015 15:05:47 -0400 Subject: [erlang-questions] using sync with cowboy/erlang.mk Message-ID: Hello I am trying to add sync ( https://github.com/rustyio/sync ) to my simple hello-world cowboy app, which is made using erlang.mk whenever I save an updated erlang file my application crashes instead of reloading the file. The error message says 'module could not be loaded' I know erlang.mk adds directories to my compiletime and runtime path, do these need to be specified to sync? -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Sun Jun 28 21:07:55 2015 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Sun, 28 Jun 2015 21:07:55 +0200 Subject: [erlang-questions] trying to learn cowboy In-Reply-To: References: Message-ID: <5590460B.302@ninenines.eu> On 06/28/2015 08:55 PM, Ben Hsu wrote: > Hello Erlangers > > I am going through some basic steps learning cowboy, and I'm doing > something wrong, but I can't figure it out. > > In the code below, I'm pattern matching against cowboy_req:method(Req), > and it _should_ be returning {'GET', _}, which takes me to the first > branch of the case statement. But it keeps executing the default case. > > I printed out what cowboy_req:method is returning, and it looks like > GET, In the spirit of shotgun-debugging this I've tried matching against > 'GET', "GET", <<'GET'>>, and <<"GET">>, none of which work > > I'm sure there is something simple I am missing here. What is it? > > > Thank you for your time and patience :) > > handle(Req, State) -> > Reply = case cowboy_req:method(Req) of > {'GET', _} -> {<<"GET">>, _} Not sure where you saw any 'GET'. :-) > % this is never executed when I do a curl-GET against my app > SomeMsg = "some message", > {ok, Req2} = cowboy_req:reply(200, > [{<<"content-type">>, <<"text/plain">>}], > SomeMsg, > Req), > {ok, Req2, State}; > _ -> > % even though i am printing out what cowboy_req:method returns here and > it says GET > {FNORD, _} = cowboy_req:method(Req), > {ok, R} = cowboy_req:reply(200, [], FNORD, Req), > R > end, > {ok, Reply, State}. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From essen@REDACTED Sun Jun 28 21:10:33 2015 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Sun, 28 Jun 2015 21:10:33 +0200 Subject: [erlang-questions] using sync with cowboy/erlang.mk In-Reply-To: References: Message-ID: <559046A9.3020300@ninenines.eu> Add: {dev_mode, true}. To your relx.config. And see the 2 applications needed for the release: https://github.com/rustyio/sync#sync-with-relx Not sure why sync doesn't just depend on them, but that should do it. On 06/28/2015 09:05 PM, Ben Hsu wrote: > Hello > > I am trying to add sync ( https://github.com/rustyio/sync ) to my > simple hello-world cowboy app, which is made using erlang.mk > > > whenever I save an updated erlang file my application crashes instead of > reloading the file. The error message says 'module could not be loaded' > > I know erlang.mk adds directories to my compiletime > and runtime path, do these need to be specified to sync? > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From benhsu@REDACTED Sun Jun 28 21:17:10 2015 From: benhsu@REDACTED (Ben Hsu) Date: Sun, 28 Jun 2015 15:17:10 -0400 Subject: [erlang-questions] trying to learn cowboy In-Reply-To: <5590460B.302@ninenines.eu> References: <5590460B.302@ninenines.eu> Message-ID: On Sun, Jun 28, 2015 at 3:07 PM, Lo?c Hoguin wrote: >> >> handle(Req, State) -> >> Reply = case cowboy_req:method(Req) of >> {'GET', _} -> > > > {<<"GET">>, _} > Thank you Lo?c, I thought I tried that but apparently I didn't. It worked From benhsu@REDACTED Sun Jun 28 21:17:43 2015 From: benhsu@REDACTED (Ben Hsu) Date: Sun, 28 Jun 2015 15:17:43 -0400 Subject: [erlang-questions] using sync with cowboy/erlang.mk In-Reply-To: <559046A9.3020300@ninenines.eu> References: <559046A9.3020300@ninenines.eu> Message-ID: That was it! Thank you On Sun, Jun 28, 2015 at 3:10 PM, Lo?c Hoguin wrote: > Add: > > {dev_mode, true}. > > To your relx.config. > > And see the 2 applications needed for the release: > https://github.com/rustyio/sync#sync-with-relx > > Not sure why sync doesn't just depend on them, but that should do it. > From ingela.andin@REDACTED Mon Jun 29 10:46:55 2015 From: ingela.andin@REDACTED (Ingela Andin) Date: Mon, 29 Jun 2015 10:46:55 +0200 Subject: [erlang-questions] example of partial_chain in SSL In-Reply-To: References: Message-ID: Hi! 2015-06-27 11:38 GMT+02:00 Benoit Chesneau : > Ingela, > > So it's not clear yet if the it was t-is the exact error here. It have > been fixed by updating the list of PEM in the file in hackney using apple > certificates store. The error I am referring has been reported here: > https://github.com/benoitc/hackney/issues/196 > > So it is probably that apple is including an intermediate certificate that > is not in the list provided by Mozilla. > > To be sure to understand, when a peer is not trusted by the validation > function, will the partial_chain function still be executed? What is the > order? I thought the partial_chain function would be executed first > returning one of the certificate in the chain? In that case why it's not > executed in the code snippet above? (i can provide you a full branch if it > helps) > > More generally what is the common pattern in that case if any? > > The partial_chain function will be called if the "top"-certificate in the certificate chain sent by the peer is not self-signed and found in the trusted CA-store. This is done before calling the public_key:path_validation. The partial_chain function may claim one of the certificates present in the chain to be trusted, then that certificate will be used as the trusted CA in the path_validation and certificates above the claimed certificate in the chain will be disregarded and the once below will be path-validated. As for your particular problem it hard to say unless I can see all the inputs. Regards Ingela Erlang/OTP team - Ericsson AB > - benoit > > > > On Thu, Jun 25, 2015 at 4:22 PM Ingela Andin > wrote: > >> Hi! >> >> 2015-06-24 19:52 GMT+02:00 Benoit Chesneau : >> >>> Hi, >>> >>> I tried to use the partial_chain option in SSL to fix an unknown_ca >>> issue but the function is never executed: >>> >>> >> >> The partial chain function lets you shorten the certificate chain by >> accepting an intermediate cert sent to you by the peer as trusted. This is >> not the same as ignoring unknown_ca errors. >> If you want to handle incorrect clients (sending incomplete chains) by >> building the chain to the client certificate on the server side , if >> possible, you need to do that in the verify_fun when it fails and then call >> public_key:pkix_path_validation again with the chain that you built. >> >> >> Regards Ingela Erlang/OTP Team - Ericsson AB >> >> >> >>> The code is: >>> >>> enum_cacerts([], _Certs) -> >>> unknown_ca; >>> enum_cacerts([Cert| Rest], Certs) -> >>> case lists:member(Cert, Certs) of >>> true -> {trusted_ca, Cert}; >>> false -> enum_cacerts(Rest, Certs) >>> end. >>> >>> >>> CACertFile = filename:join(hackney_util:privdir(), >>> "ca-bundle.crt"), >>> {ok, ServerCAs} = file:read_file(CACertFile), >>> Pems = public_key:pem_decode(ServerCAs), >>> CaCerts = lists:map(fun({_, Der, _}) -> Der end, Pems), >>> >>> PartialChain = fun(ChainCerts) -> >>> enum_cacerts(CaCerts, ChainCerts) >>> end, >>> >>> And the SSL options are: >>> >>> [{partial_chain, PartialChain}, >>> {cacerts, CaCerts}, >>> {server_name_indication, Host}, >>> {verify_fun, {fun ssl_verify_hostname:verify_fun/3, >>> [{check_hostname, Host}]}}, >>> {verify, verify_peer}, >>> {depth, 99}]; >>> >>> What am I doing wrong? I am not sure actually why the function is never >>> executed. Any idea is welcome... >>> >>> - benoit >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From donpedrothird@REDACTED Mon Jun 29 14:46:19 2015 From: donpedrothird@REDACTED (John Doe) Date: Mon, 29 Jun 2015 15:46:19 +0300 Subject: [erlang-questions] trying to learn cowboy In-Reply-To: <5590460B.302@ninenines.eu> References: <5590460B.302@ninenines.eu> Message-ID: Lo?c, while you are there, is it possible to make a route which accepts unlimited number of slashes in PathMatch and get path with slashes as a named parameter? Like, the if the first segment is /a/ get allthe next segments as a single parameter, be it /a/b/ or /a/c/d/e/f/ ? 2015-06-28 22:07 GMT+03:00 Lo?c Hoguin : > > > On 06/28/2015 08:55 PM, Ben Hsu wrote: > >> Hello Erlangers >> >> I am going through some basic steps learning cowboy, and I'm doing >> something wrong, but I can't figure it out. >> >> In the code below, I'm pattern matching against cowboy_req:method(Req), >> and it _should_ be returning {'GET', _}, which takes me to the first >> branch of the case statement. But it keeps executing the default case. >> >> I printed out what cowboy_req:method is returning, and it looks like >> GET, In the spirit of shotgun-debugging this I've tried matching against >> 'GET', "GET", <<'GET'>>, and <<"GET">>, none of which work >> >> I'm sure there is something simple I am missing here. What is it? >> >> >> Thank you for your time and patience :) >> >> handle(Req, State) -> >> Reply = case cowboy_req:method(Req) of >> {'GET', _} -> >> > > {<<"GET">>, _} > > Not sure where you saw any 'GET'. :-) > > % this is never executed when I do a curl-GET against my app >> SomeMsg = "some message", >> {ok, Req2} = cowboy_req:reply(200, >> [{<<"content-type">>, <<"text/plain">>}], >> SomeMsg, >> Req), >> {ok, Req2, State}; >> _ -> >> % even though i am printing out what cowboy_req:method returns here and >> it says GET >> {FNORD, _} = cowboy_req:method(Req), >> {ok, R} = cowboy_req:reply(200, [], FNORD, Req), >> R >> end, >> {ok, Reply, State}. >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bog495@REDACTED Mon Jun 29 14:58:26 2015 From: bog495@REDACTED (Bogdan Andu) Date: Mon, 29 Jun 2015 15:58:26 +0300 Subject: [erlang-questions] configure http methods in yaws In-Reply-To: References: Message-ID: Hi, I have the following config: .... port = 8088 listen = 127.0.0.1 listen_backlog = 100 dispatchmod = dispatch_rewrite docroot = /tmp revproxy = / http://127.0.0.1:8080/ intercept_mod intercept_cgi ..... The precedence is dispatch_rewrite -> intercept_cgi ? How it is possible to capture POST data in reverse proxy mode in Yaws with dispatchmod dispatch_rewrite? I try to capture POST data but Arg#arg.querydata is undefined. I want to capture the POST string like a=1&b=2 to have it analyzed in dispatchmod. Also yaws_api:parse_post(Arg). doesn't work (perhaps uses Arg#arg.querydata). Thanks, Bogdan On Sun, Jun 28, 2015 at 6:20 PM, Bogdan Andu wrote: > Hi, > > I know the docs > and I run internally Yaws in reverse proxy mode > and I want this in Internet facing setup also > > I searched the net 'yaws reverse proxy' and I found: > > 1) > http://stackoverflow.com/questions/917546/has-anybody-used-yaws-server-as-an-http-proxy > although 6 years old, is Yaws in reverse proxy mode comparable or even > better than varnis, haproxy, nginx? > > 2) http://osdir.com/ml/web.server.yaws.general/2007-12/msg00000.html > this one is from klacke and he speaks about difficulties he > encountered writing revproxy engine.as well as an OTP limitation > being the main obstacle in overcoming these. > Are these still apply today? > > 3) also found this: > http://www.erlang-factory.com/upload/presentations/752/reed-efsf2013-whatsapp.pdf > it seems whatsapp useses or used yaws in revproxy mode with some tweaks > > The setup I want is simple: > > Because I have the applications written in other language > and for rewriting them in Erlang I dont have the time I must > use this setup: > > - Yaws in front-end in revproxy mode with interception module with plenty > of check > on headers, cookies, etc > - Twiggy/Starlet/Starman as back-end or psgi server > more info here: http://www.slideshare.net/kazeburo/yapc2013psgi-plack > > I want to keepalive connections between yaws and psgi servers to avoid > 3-way handshake overhead. Although with outside world I want disable > keepalive > and set 'connection: close' and all of thiese can be done by altering > the headers > tru interception module. > > > Is it safe to keepalive connections between Yaws and Twiggy for > example which is an Libevent implementation web server? > Or Starlet/Starman like web server which has a parallel pre-fork model? > > Thanks and sorry for long post, > > Bogdan > > > > > On Sun, Jun 28, 2015 at 4:51 AM, Steve Vinoski wrote: > >> >> >> On Sat, Jun 27, 2015 at 4:58 AM, Bogdan Andu wrote: >> >>> Hi, >>> >>> About yaws as reverse proxy.. >>> >>> I want to use yaws as a reverse proxy in a >>> http -> http setup. no ssl involved whatsoever. >>> >>> I am interested in interception module where I want >>> to apply various checks on headers, query string, etc >>> making this some kind of www firewall . >>> >>> Is this feature of yaws production ready ? >>> >> >> Yes. You can find details about it in chapter 13 of >> http://yaws.hyber.org/yaws.pdf, or under the revproxy section of >> http://yaws.hyber.org/yman.yaws?page=yaws.conf . >> >> --steve >> >> >> >>> >>> >>> Thanks, >>> Bogdan >>> >>> >>> On Fri, Feb 13, 2015 at 6:14 PM, Steve Vinoski wrote: >>> >>>> I don't recall seeing Yaws users asking for this config feature in the >>>> past, so it's unlikely we'll add it. But what you're asking for -- a >>>> configuration point for methods -- would be implemented much as I've shown >>>> in my previous emails, much like a dispatchmod. The dispatchmod is as early >>>> in the request handling process as you can get after the formation of the >>>> #arg{}. The dispatchmod code I provided requires less configuration than >>>> what you're showing, even for the default case, plus if having to have a >>>> new module concerns you, the dispatch/1 function can be added to some other >>>> existing module you already have instead. >>>> >>>> --steve >>>> >>>> >>>> >>>> On Fri, Feb 13, 2015 at 4:30 AM, Bogdan Andu wrote: >>>> >>>>> Yes but the point is to have a default configuration that can be >>>>> overridden by such a mechanism >>>>> if one is configured. >>>>> The 99 percent of cases only need a default behaviour. >>>>> >>>>> The way I see this is to have something like that (all in one): >>>>> >>>>> >>>>> mod_405=my_405_handle_module >>>>> .... >>>>> >>>>> >>>>> in this way we can also customize the response if a method other than >>>>> GET or POST is sent to the server >>>>> >>>>> On Fri, Feb 13, 2015 at 10:17 AM, Imants Cekusins >>>>> wrote: >>>>> >>>>>> > Traffic with methods not allowed should be discarded with 405 >>>>>> >>>>>> you see, someone else might prefer another action depending on method >>>>>> not allowed. >>>>>> >>>>>> a dedicated attribute may be convenient but then someone would ask: >>>>>> "how do I change the response code? how do I redirect?". Current >>>>>> approach gives you choice. >>>>>> >>>>>> one of those cases when there is more than one approach, a prefers A, >>>>>> b prefers B. Both have a valid point. >>>>>> >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Mon Jun 29 15:02:31 2015 From: t@REDACTED (Tristan Sloughter) Date: Mon, 29 Jun 2015 08:02:31 -0500 Subject: [erlang-questions] [ANN] Rebar3 beta-1 Message-ID: <1435582951.3817490.310466713.3BA9347A@webmail.messagingengine.com> It has been almost a year since Rebar3: The Great Refactoring began (first commit July 27, 2014!) and we (Fred and I) are now happy to announce the first beta release. The source code is available at https://github.com/rebar/rebar3 and the documentation at http://rebar3.org What does beta mean? We are feature complete for 3.0 and have numerous plugins available to fill in gaps left by removed rebar2 features, available at http://www.rebar3.org/v3.0/docs/using-available-plugins A large reason for the backwards incompatible changes was to take a new approach to how dependency discovery, figuring out what and how to build projects, and the base execution model, but we also snuck in a number of new features: * Repeatable builds with deterministic conflict resolution: http://www.rebar3.org/v3.0/docs/dependencies * Deterministic dependency upgrades: http://www.rebar3.org/v3.0/docs/dependencies#upgrading-source-dependencies * Profiles: http://www.rebar3.org/v3.0/docs/profiles * Overrides: http://www.rebar3.org/v3.0/docs/configuration#overrides * Hex.pm packages: http://www.rebar3.org/v3.0/docs/publishing-packages * Relx for releases, relups, and tarballs: http://www.rebar3.org/v3.0/docs/releases * Documentation is treated as a feature: http://rebar3.org/ * Powerful plugin system: http://www.rebar3.org/v3.0/docs/plugins The configuration format mostly remains compatible with rebar 2.x configuration files. Some 2.x options will be ignored by rebar3 and some rebar3 options will be ignored by 2.x, but most pure Erlang projects out there that used rebar to build will keep building fine. Huge thanks everyone, and thanks to contributors who helped us reach the rebar3 beta version. Particular thanks go to Daniel Widgren (https://github.com/Taure), Alisdair Sullivan (@talentdeficit), James Fish (@fishcakez), and Viacheslav V. Kovalev (https://github.com/kovyl2404) for the heavy load of work they've done towards this project. Thanks to all the other contributors and original rebar contributors too. From essen@REDACTED Mon Jun 29 15:20:08 2015 From: essen@REDACTED (=?UTF-8?B?TG/Dr2MgSG9ndWlu?=) Date: Mon, 29 Jun 2015 15:20:08 +0200 Subject: [erlang-questions] trying to learn cowboy In-Reply-To: References: <5590460B.302@ninenines.eu> Message-ID: <55914608.4090800@ninenines.eu> That's the "/hats/[...]" construct. :-) You can get the [...] part in the cowboy_req:path_info function, as a list of segments. On 06/29/2015 02:46 PM, John Doe wrote: > Lo?c, while you are there, is it possible to make a route which accepts > unlimited number of slashes in PathMatch and get path with slashes as a > named parameter? > Like, the if the first segment is /a/ get allthe next segments as a > single parameter, be it /a/b/ or /a/c/d/e/f/ ? > > 2015-06-28 22:07 GMT+03:00 Lo?c Hoguin >: > > > > On 06/28/2015 08:55 PM, Ben Hsu wrote: > > Hello Erlangers > > I am going through some basic steps learning cowboy, and I'm doing > something wrong, but I can't figure it out. > > In the code below, I'm pattern matching against > cowboy_req:method(Req), > and it _should_ be returning {'GET', _}, which takes me to the first > branch of the case statement. But it keeps executing the default > case. > > I printed out what cowboy_req:method is returning, and it looks like > GET, In the spirit of shotgun-debugging this I've tried matching > against > 'GET', "GET", <<'GET'>>, and <<"GET">>, none of which work > > I'm sure there is something simple I am missing here. What is it? > > > Thank you for your time and patience :) > > handle(Req, State) -> > Reply = case cowboy_req:method(Req) of > {'GET', _} -> > > > {<<"GET">>, _} > > Not sure where you saw any 'GET'. :-) > > % this is never executed when I do a curl-GET against my app > SomeMsg = "some message", > {ok, Req2} = cowboy_req:reply(200, > [{<<"content-type">>, <<"text/plain">>}], > SomeMsg, > Req), > {ok, Req2, State}; > _ -> > % even though i am printing out what cowboy_req:method returns > here and > it says GET > {FNORD, _} = cowboy_req:method(Req), > {ok, R} = cowboy_req:reply(200, [], FNORD, Req), > R > end, > {ok, Reply, State}. > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -- > Lo?c Hoguin > http://ninenines.eu > Author of The Erlanger Playbook, > A book about software development using Erlang > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin http://ninenines.eu Author of The Erlanger Playbook, A book about software development using Erlang From vinoski@REDACTED Mon Jun 29 16:49:18 2015 From: vinoski@REDACTED (Steve Vinoski) Date: Mon, 29 Jun 2015 10:49:18 -0400 Subject: [erlang-questions] configure http methods in yaws In-Reply-To: References: Message-ID: On Sun, Jun 28, 2015 at 11:20 AM, Bogdan Andu wrote: > Hi, > > I know the docs > and I run internally Yaws in reverse proxy mode > and I want this in Internet facing setup also > > I searched the net 'yaws reverse proxy' and I found: > > 1) > http://stackoverflow.com/questions/917546/has-anybody-used-yaws-server-as-an-http-proxy > although 6 years old, is Yaws in reverse proxy mode comparable or even > better than varnis, haproxy, nginx? > That question/answer is out of date, since revproxy code was largely refactored in the 2012-2014 timeframe. > 2) http://osdir.com/ml/web.server.yaws.general/2007-12/msg00000.html > this one is from klacke and he speaks about difficulties he > encountered writing revproxy engine.as well as an OTP limitation > being the main obstacle in overcoming these. > Are these still apply today? > Probably not, given the rewrite. > 3) also found this: > http://www.erlang-factory.com/upload/presentations/752/reed-efsf2013-whatsapp.pdf > it seems whatsapp useses or used yaws in revproxy mode with some tweaks > > The setup I want is simple: > > Because I have the applications written in other language > and for rewriting them in Erlang I dont have the time I must > use this setup: > > - Yaws in front-end in revproxy mode with interception module with plenty > of check > on headers, cookies, etc > - Twiggy/Starlet/Starman as back-end or psgi server > more info here: http://www.slideshare.net/kazeburo/yapc2013psgi-plack > > I want to keepalive connections between yaws and psgi servers to avoid > 3-way handshake overhead. Although with outside world I want disable > keepalive > and set 'connection: close' and all of thiese can be done by altering > the headers > tru interception module. > > > Is it safe to keepalive connections between Yaws and Twiggy for > example which is an Libevent implementation web server? > Or Starlet/Starman like web server which has a parallel pre-fork model? > Seems like it should be OK but I've never used the backend servers you're talking about, so I can't say for sure whether it's safe or not. You might try asking on the erlyaws mailing list (see https://lists.sourceforge.net/lists/listinfo/erlyaws-list). --steve > Thanks and sorry for long post, > > Bogdan > > > > > On Sun, Jun 28, 2015 at 4:51 AM, Steve Vinoski wrote: > >> >> >> On Sat, Jun 27, 2015 at 4:58 AM, Bogdan Andu wrote: >> >>> Hi, >>> >>> About yaws as reverse proxy.. >>> >>> I want to use yaws as a reverse proxy in a >>> http -> http setup. no ssl involved whatsoever. >>> >>> I am interested in interception module where I want >>> to apply various checks on headers, query string, etc >>> making this some kind of www firewall . >>> >>> Is this feature of yaws production ready ? >>> >> >> Yes. You can find details about it in chapter 13 of >> http://yaws.hyber.org/yaws.pdf, or under the revproxy section of >> http://yaws.hyber.org/yman.yaws?page=yaws.conf . >> >> --steve >> >> >> >>> >>> >>> Thanks, >>> Bogdan >>> >>> >>> On Fri, Feb 13, 2015 at 6:14 PM, Steve Vinoski wrote: >>> >>>> I don't recall seeing Yaws users asking for this config feature in the >>>> past, so it's unlikely we'll add it. But what you're asking for -- a >>>> configuration point for methods -- would be implemented much as I've shown >>>> in my previous emails, much like a dispatchmod. The dispatchmod is as early >>>> in the request handling process as you can get after the formation of the >>>> #arg{}. The dispatchmod code I provided requires less configuration than >>>> what you're showing, even for the default case, plus if having to have a >>>> new module concerns you, the dispatch/1 function can be added to some other >>>> existing module you already have instead. >>>> >>>> --steve >>>> >>>> >>>> >>>> On Fri, Feb 13, 2015 at 4:30 AM, Bogdan Andu wrote: >>>> >>>>> Yes but the point is to have a default configuration that can be >>>>> overridden by such a mechanism >>>>> if one is configured. >>>>> The 99 percent of cases only need a default behaviour. >>>>> >>>>> The way I see this is to have something like that (all in one): >>>>> >>>>> >>>>> mod_405=my_405_handle_module >>>>> .... >>>>> >>>>> >>>>> in this way we can also customize the response if a method other than >>>>> GET or POST is sent to the server >>>>> >>>>> On Fri, Feb 13, 2015 at 10:17 AM, Imants Cekusins >>>>> wrote: >>>>> >>>>>> > Traffic with methods not allowed should be discarded with 405 >>>>>> >>>>>> you see, someone else might prefer another action depending on method >>>>>> not allowed. >>>>>> >>>>>> a dedicated attribute may be convenient but then someone would ask: >>>>>> "how do I change the response code? how do I redirect?". Current >>>>>> approach gives you choice. >>>>>> >>>>>> one of those cases when there is more than one approach, a prefers A, >>>>>> b prefers B. Both have a valid point. >>>>>> >>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bog495@REDACTED Mon Jun 29 17:10:36 2015 From: bog495@REDACTED (Bogdan Andu) Date: Mon, 29 Jun 2015 18:10:36 +0300 Subject: [erlang-questions] configure http methods in yaws In-Reply-To: References: Message-ID: Thanks for reply. I tested myself yaws in revproxy and I like it. Although I don't know how to capture POST data which should be present in Arg#arg.clidata field which is also undefined. I searched the web and docs and found nothing. I wrongly assumed that field Arg#arg.querydata hold POST data I want POST data to apply some regular expression checks (like mod_rewrite in Apache) on them Thanks, Bogdan On Mon, Jun 29, 2015 at 5:49 PM, Steve Vinoski wrote: > > > On Sun, Jun 28, 2015 at 11:20 AM, Bogdan Andu wrote: > >> Hi, >> >> I know the docs >> and I run internally Yaws in reverse proxy mode >> and I want this in Internet facing setup also >> >> I searched the net 'yaws reverse proxy' and I found: >> >> 1) >> http://stackoverflow.com/questions/917546/has-anybody-used-yaws-server-as-an-http-proxy >> although 6 years old, is Yaws in reverse proxy mode comparable or even >> better than varnis, haproxy, nginx? >> > > That question/answer is out of date, since revproxy code was largely > refactored in the 2012-2014 timeframe. > > >> 2) http://osdir.com/ml/web.server.yaws.general/2007-12/msg00000.html >> this one is from klacke and he speaks about difficulties he >> encountered writing revproxy engine.as well as an OTP limitation >> being the main obstacle in overcoming these. >> Are these still apply today? >> > > Probably not, given the rewrite. > > >> 3) also found this: >> http://www.erlang-factory.com/upload/presentations/752/reed-efsf2013-whatsapp.pdf >> it seems whatsapp useses or used yaws in revproxy mode with some >> tweaks >> >> The setup I want is simple: >> >> Because I have the applications written in other language >> and for rewriting them in Erlang I dont have the time I must >> use this setup: >> >> - Yaws in front-end in revproxy mode with interception module with >> plenty of check >> on headers, cookies, etc >> - Twiggy/Starlet/Starman as back-end or psgi server >> more info here: http://www.slideshare.net/kazeburo/yapc2013psgi-plack >> >> I want to keepalive connections between yaws and psgi servers to avoid >> 3-way handshake overhead. Although with outside world I want disable >> keepalive >> and set 'connection: close' and all of thiese can be done by altering >> the headers >> tru interception module. >> >> >> Is it safe to keepalive connections between Yaws and Twiggy for >> example which is an Libevent implementation web server? >> Or Starlet/Starman like web server which has a parallel pre-fork model? >> > > Seems like it should be OK but I've never used the backend servers you're > talking about, so I can't say for sure whether it's safe or not. You might > try asking on the erlyaws mailing list (see > https://lists.sourceforge.net/lists/listinfo/erlyaws-list). > > --steve > > > >> Thanks and sorry for long post, >> >> Bogdan >> >> >> >> >> On Sun, Jun 28, 2015 at 4:51 AM, Steve Vinoski wrote: >> >>> >>> >>> On Sat, Jun 27, 2015 at 4:58 AM, Bogdan Andu wrote: >>> >>>> Hi, >>>> >>>> About yaws as reverse proxy.. >>>> >>>> I want to use yaws as a reverse proxy in a >>>> http -> http setup. no ssl involved whatsoever. >>>> >>>> I am interested in interception module where I want >>>> to apply various checks on headers, query string, etc >>>> making this some kind of www firewall . >>>> >>>> Is this feature of yaws production ready ? >>>> >>> >>> Yes. You can find details about it in chapter 13 of >>> http://yaws.hyber.org/yaws.pdf, or under the revproxy section of >>> http://yaws.hyber.org/yman.yaws?page=yaws.conf . >>> >>> --steve >>> >>> >>> >>>> >>>> >>>> Thanks, >>>> Bogdan >>>> >>>> >>>> On Fri, Feb 13, 2015 at 6:14 PM, Steve Vinoski >>>> wrote: >>>> >>>>> I don't recall seeing Yaws users asking for this config feature in the >>>>> past, so it's unlikely we'll add it. But what you're asking for -- a >>>>> configuration point for methods -- would be implemented much as I've shown >>>>> in my previous emails, much like a dispatchmod. The dispatchmod is as early >>>>> in the request handling process as you can get after the formation of the >>>>> #arg{}. The dispatchmod code I provided requires less configuration than >>>>> what you're showing, even for the default case, plus if having to have a >>>>> new module concerns you, the dispatch/1 function can be added to some other >>>>> existing module you already have instead. >>>>> >>>>> --steve >>>>> >>>>> >>>>> >>>>> On Fri, Feb 13, 2015 at 4:30 AM, Bogdan Andu wrote: >>>>> >>>>>> Yes but the point is to have a default configuration that can be >>>>>> overridden by such a mechanism >>>>>> if one is configured. >>>>>> The 99 percent of cases only need a default behaviour. >>>>>> >>>>>> The way I see this is to have something like that (all in one): >>>>>> >>>>>> >>>>>> mod_405=my_405_handle_module >>>>>> .... >>>>>> >>>>>> >>>>>> in this way we can also customize the response if a method other than >>>>>> GET or POST is sent to the server >>>>>> >>>>>> On Fri, Feb 13, 2015 at 10:17 AM, Imants Cekusins >>>>>> wrote: >>>>>> >>>>>>> > Traffic with methods not allowed should be discarded with 405 >>>>>>> >>>>>>> you see, someone else might prefer another action depending on method >>>>>>> not allowed. >>>>>>> >>>>>>> a dedicated attribute may be convenient but then someone would ask: >>>>>>> "how do I change the response code? how do I redirect?". Current >>>>>>> approach gives you choice. >>>>>>> >>>>>>> one of those cases when there is more than one approach, a prefers >>>>>>> A, >>>>>>> b prefers B. Both have a valid point. >>>>>>> >>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hugo@REDACTED Mon Jun 29 19:44:44 2015 From: hugo@REDACTED (Hugo Mills) Date: Mon, 29 Jun 2015 17:44:44 +0000 Subject: [erlang-questions] yecc and compiler warnings Message-ID: <20150629174444.GB3076@carfax.org.uk> I asked this earlier today on IRC, but it doesn't seem to have collected much interest, so I thought I might get a different set of people's attention here. I'm writing a small domain-specific language using leex and yecc (under R17 at the moment), and I'm getting a bunch of these from the module produced by yecc: ebin/linseed_parser.erl:409: Warning: function yeccpars2_3/7 is unused ebin/linseed_parser.erl:808: Warning: function yeccpars2_87/7 is unused ebin/linseed_parser.erl:822: Warning: function yeccpars2_89/7 is unused ebin/linseed_parser.erl:827: Warning: function yeccpars2_90/7 is unused ebin/linseed_parser.erl:949: Warning: function yeccgoto_line_sequence/7 is unused src/linseed_parser.yrl:20: Warning: function yeccpars2_89_/1 is unused src/linseed_parser.yrl:22: Warning: function yeccpars2_90_/1 is unused src/linseed_parser.yrl:27: Warning: function yeccpars2_87_/1 is unused The latter three lines (linseed_parser.yrl:20 and so on) do not seem to correspond to anything sensible in linseed_parser.yrl: line 20 is empty, line 22 is the first line of a production, and line 27 is the second line of a different production. Are these warnings expected from using yecc, or is there something wrong with my grammar? If the latter, how do I identify what it is from the warning messages above? Thanks, Hugo. -- Hugo Mills | Try everything once, except incest and folk-dancing. hugo@REDACTED carfax.org.uk | http://carfax.org.uk/ | PGP: E2AB1DE4 | Sir Thomas Beecham -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: From vinoski@REDACTED Mon Jun 29 19:48:14 2015 From: vinoski@REDACTED (Steve Vinoski) Date: Mon, 29 Jun 2015 13:48:14 -0400 Subject: [erlang-questions] configure http methods in yaws In-Reply-To: References: Message-ID: On Mon, Jun 29, 2015 at 11:10 AM, Bogdan Andu wrote: > Thanks for reply. > > I tested myself yaws in revproxy and > I like it. > > Although I don't know how to capture POST data > which should be present in Arg#arg.clidata field > which is also undefined. > > I searched the web and docs and found nothing. > > I wrongly assumed that field Arg#arg.querydata hold POST data > > I want POST data to apply some regular expression checks > (like mod_rewrite in Apache) on them > Pretty sure an intercept_mod has access only to information about the request, and to the headers. The revproxy code uses an internal state record to track details about POST data and such, but an intercept mod doesn't have access to that state. You might consider posting an issue to the yaws github project (https://github.com/klacke/yaws) to see if this functionality can be added. --steve > Thanks, > Bogdan > > > On Mon, Jun 29, 2015 at 5:49 PM, Steve Vinoski wrote: > >> >> >> On Sun, Jun 28, 2015 at 11:20 AM, Bogdan Andu wrote: >> >>> Hi, >>> >>> I know the docs >>> and I run internally Yaws in reverse proxy mode >>> and I want this in Internet facing setup also >>> >>> I searched the net 'yaws reverse proxy' and I found: >>> >>> 1) >>> http://stackoverflow.com/questions/917546/has-anybody-used-yaws-server-as-an-http-proxy >>> although 6 years old, is Yaws in reverse proxy mode comparable or >>> even >>> better than varnis, haproxy, nginx? >>> >> >> That question/answer is out of date, since revproxy code was largely >> refactored in the 2012-2014 timeframe. >> >> >>> 2) http://osdir.com/ml/web.server.yaws.general/2007-12/msg00000.html >>> this one is from klacke and he speaks about difficulties he >>> encountered writing revproxy engine.as well as an OTP limitation >>> being the main obstacle in overcoming these. >>> Are these still apply today? >>> >> >> Probably not, given the rewrite. >> >> >>> 3) also found this: >>> http://www.erlang-factory.com/upload/presentations/752/reed-efsf2013-whatsapp.pdf >>> it seems whatsapp useses or used yaws in revproxy mode with some >>> tweaks >>> >>> The setup I want is simple: >>> >>> Because I have the applications written in other language >>> and for rewriting them in Erlang I dont have the time I must >>> use this setup: >>> >>> - Yaws in front-end in revproxy mode with interception module with >>> plenty of check >>> on headers, cookies, etc >>> - Twiggy/Starlet/Starman as back-end or psgi server >>> more info here: http://www.slideshare.net/kazeburo/yapc2013psgi-plack >>> >>> I want to keepalive connections between yaws and psgi servers to avoid >>> 3-way handshake overhead. Although with outside world I want disable >>> keepalive >>> and set 'connection: close' and all of thiese can be done by altering >>> the headers >>> tru interception module. >>> >>> >>> Is it safe to keepalive connections between Yaws and Twiggy for >>> example which is an Libevent implementation web server? >>> Or Starlet/Starman like web server which has a parallel pre-fork model? >>> >> >> Seems like it should be OK but I've never used the backend servers you're >> talking about, so I can't say for sure whether it's safe or not. You might >> try asking on the erlyaws mailing list (see >> https://lists.sourceforge.net/lists/listinfo/erlyaws-list). >> >> --steve >> >> >> >>> Thanks and sorry for long post, >>> >>> Bogdan >>> >>> >>> >>> >>> On Sun, Jun 28, 2015 at 4:51 AM, Steve Vinoski wrote: >>> >>>> >>>> >>>> On Sat, Jun 27, 2015 at 4:58 AM, Bogdan Andu wrote: >>>> >>>>> Hi, >>>>> >>>>> About yaws as reverse proxy.. >>>>> >>>>> I want to use yaws as a reverse proxy in a >>>>> http -> http setup. no ssl involved whatsoever. >>>>> >>>>> I am interested in interception module where I want >>>>> to apply various checks on headers, query string, etc >>>>> making this some kind of www firewall . >>>>> >>>>> Is this feature of yaws production ready ? >>>>> >>>> >>>> Yes. You can find details about it in chapter 13 of >>>> http://yaws.hyber.org/yaws.pdf, or under the revproxy section of >>>> http://yaws.hyber.org/yman.yaws?page=yaws.conf . >>>> >>>> --steve >>>> >>>> >>>> >>>>> >>>>> >>>>> Thanks, >>>>> Bogdan >>>>> >>>>> >>>>> On Fri, Feb 13, 2015 at 6:14 PM, Steve Vinoski >>>>> wrote: >>>>> >>>>>> I don't recall seeing Yaws users asking for this config feature in >>>>>> the past, so it's unlikely we'll add it. But what you're asking for -- a >>>>>> configuration point for methods -- would be implemented much as I've shown >>>>>> in my previous emails, much like a dispatchmod. The dispatchmod is as early >>>>>> in the request handling process as you can get after the formation of the >>>>>> #arg{}. The dispatchmod code I provided requires less configuration than >>>>>> what you're showing, even for the default case, plus if having to have a >>>>>> new module concerns you, the dispatch/1 function can be added to some other >>>>>> existing module you already have instead. >>>>>> >>>>>> --steve >>>>>> >>>>>> >>>>>> >>>>>> On Fri, Feb 13, 2015 at 4:30 AM, Bogdan Andu >>>>>> wrote: >>>>>> >>>>>>> Yes but the point is to have a default configuration that can be >>>>>>> overridden by such a mechanism >>>>>>> if one is configured. >>>>>>> The 99 percent of cases only need a default behaviour. >>>>>>> >>>>>>> The way I see this is to have something like that (all in one): >>>>>>> >>>>>>> >>>>>>> mod_405=my_405_handle_module >>>>>>> .... >>>>>>> >>>>>>> >>>>>>> in this way we can also customize the response if a method other >>>>>>> than GET or POST is sent to the server >>>>>>> >>>>>>> On Fri, Feb 13, 2015 at 10:17 AM, Imants Cekusins >>>>>>> wrote: >>>>>>> >>>>>>>> > Traffic with methods not allowed should be discarded with 405 >>>>>>>> >>>>>>>> you see, someone else might prefer another action depending on >>>>>>>> method >>>>>>>> not allowed. >>>>>>>> >>>>>>>> a dedicated attribute may be convenient but then someone would ask: >>>>>>>> "how do I change the response code? how do I redirect?". Current >>>>>>>> approach gives you choice. >>>>>>>> >>>>>>>> one of those cases when there is more than one approach, a prefers >>>>>>>> A, >>>>>>>> b prefers B. Both have a valid point. >>>>>>>> >>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bog495@REDACTED Tue Jun 30 12:38:11 2015 From: bog495@REDACTED (Bogdan Andu) Date: Tue, 30 Jun 2015 13:38:11 +0300 Subject: [erlang-questions] configure http methods in yaws In-Reply-To: References: Message-ID: I know intercept module does not have clidata populated. I was saying that in dispatch module I want POST data. In a configuration like this: .... port = 8088 listen = 127.0.0.1 listen_backlog = 100 dispatchmod = dispatch_rewrite docroot = /tmp revproxy = / http://127.0.0.1:8080/ intercept_mod intercept_cgi I thought dispatch_rewrite to give me clidata, but clidata for a POST to a cgi script remains undefined. Thanks, Bogdan On Mon, Jun 29, 2015 at 8:48 PM, Steve Vinoski wrote: > > > On Mon, Jun 29, 2015 at 11:10 AM, Bogdan Andu wrote: > >> Thanks for reply. >> >> I tested myself yaws in revproxy and >> I like it. >> >> Although I don't know how to capture POST data >> which should be present in Arg#arg.clidata field >> which is also undefined. >> >> I searched the web and docs and found nothing. >> >> I wrongly assumed that field Arg#arg.querydata hold POST data >> >> I want POST data to apply some regular expression checks >> (like mod_rewrite in Apache) on them >> > > Pretty sure an intercept_mod has access only to information about the > request, and to the headers. The revproxy code uses an internal state > record to track details about POST data and such, but an intercept mod > doesn't have access to that state. You might consider posting an issue to > the yaws github project (https://github.com/klacke/yaws) to see if this > functionality can be added. > > --steve > > > >> Thanks, >> Bogdan >> >> >> On Mon, Jun 29, 2015 at 5:49 PM, Steve Vinoski wrote: >> >>> >>> >>> On Sun, Jun 28, 2015 at 11:20 AM, Bogdan Andu wrote: >>> >>>> Hi, >>>> >>>> I know the docs >>>> and I run internally Yaws in reverse proxy mode >>>> and I want this in Internet facing setup also >>>> >>>> I searched the net 'yaws reverse proxy' and I found: >>>> >>>> 1) >>>> http://stackoverflow.com/questions/917546/has-anybody-used-yaws-server-as-an-http-proxy >>>> although 6 years old, is Yaws in reverse proxy mode comparable or >>>> even >>>> better than varnis, haproxy, nginx? >>>> >>> >>> That question/answer is out of date, since revproxy code was largely >>> refactored in the 2012-2014 timeframe. >>> >>> >>>> 2) http://osdir.com/ml/web.server.yaws.general/2007-12/msg00000.html >>>> this one is from klacke and he speaks about difficulties he >>>> encountered writing revproxy engine.as well as an OTP limitation >>>> being the main obstacle in overcoming these. >>>> Are these still apply today? >>>> >>> >>> Probably not, given the rewrite. >>> >>> >>>> 3) also found this: >>>> http://www.erlang-factory.com/upload/presentations/752/reed-efsf2013-whatsapp.pdf >>>> it seems whatsapp useses or used yaws in revproxy mode with some >>>> tweaks >>>> >>>> The setup I want is simple: >>>> >>>> Because I have the applications written in other language >>>> and for rewriting them in Erlang I dont have the time I must >>>> use this setup: >>>> >>>> - Yaws in front-end in revproxy mode with interception module with >>>> plenty of check >>>> on headers, cookies, etc >>>> - Twiggy/Starlet/Starman as back-end or psgi server >>>> more info here: >>>> http://www.slideshare.net/kazeburo/yapc2013psgi-plack >>>> >>>> I want to keepalive connections between yaws and psgi servers to avoid >>>> 3-way handshake overhead. Although with outside world I want disable >>>> keepalive >>>> and set 'connection: close' and all of thiese can be done by altering >>>> the headers >>>> tru interception module. >>>> >>>> >>>> Is it safe to keepalive connections between Yaws and Twiggy for >>>> example which is an Libevent implementation web server? >>>> Or Starlet/Starman like web server which has a parallel pre-fork model? >>>> >>> >>> Seems like it should be OK but I've never used the backend servers >>> you're talking about, so I can't say for sure whether it's safe or not. You >>> might try asking on the erlyaws mailing list (see >>> https://lists.sourceforge.net/lists/listinfo/erlyaws-list). >>> >>> --steve >>> >>> >>> >>>> Thanks and sorry for long post, >>>> >>>> Bogdan >>>> >>>> >>>> >>>> >>>> On Sun, Jun 28, 2015 at 4:51 AM, Steve Vinoski >>>> wrote: >>>> >>>>> >>>>> >>>>> On Sat, Jun 27, 2015 at 4:58 AM, Bogdan Andu wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> About yaws as reverse proxy.. >>>>>> >>>>>> I want to use yaws as a reverse proxy in a >>>>>> http -> http setup. no ssl involved whatsoever. >>>>>> >>>>>> I am interested in interception module where I want >>>>>> to apply various checks on headers, query string, etc >>>>>> making this some kind of www firewall . >>>>>> >>>>>> Is this feature of yaws production ready ? >>>>>> >>>>> >>>>> Yes. You can find details about it in chapter 13 of >>>>> http://yaws.hyber.org/yaws.pdf, or under the revproxy section of >>>>> http://yaws.hyber.org/yman.yaws?page=yaws.conf . >>>>> >>>>> --steve >>>>> >>>>> >>>>> >>>>>> >>>>>> >>>>>> Thanks, >>>>>> Bogdan >>>>>> >>>>>> >>>>>> On Fri, Feb 13, 2015 at 6:14 PM, Steve Vinoski >>>>>> wrote: >>>>>> >>>>>>> I don't recall seeing Yaws users asking for this config feature in >>>>>>> the past, so it's unlikely we'll add it. But what you're asking for -- a >>>>>>> configuration point for methods -- would be implemented much as I've shown >>>>>>> in my previous emails, much like a dispatchmod. The dispatchmod is as early >>>>>>> in the request handling process as you can get after the formation of the >>>>>>> #arg{}. The dispatchmod code I provided requires less configuration than >>>>>>> what you're showing, even for the default case, plus if having to have a >>>>>>> new module concerns you, the dispatch/1 function can be added to some other >>>>>>> existing module you already have instead. >>>>>>> >>>>>>> --steve >>>>>>> >>>>>>> >>>>>>> >>>>>>> On Fri, Feb 13, 2015 at 4:30 AM, Bogdan Andu >>>>>>> wrote: >>>>>>> >>>>>>>> Yes but the point is to have a default configuration that can be >>>>>>>> overridden by such a mechanism >>>>>>>> if one is configured. >>>>>>>> The 99 percent of cases only need a default behaviour. >>>>>>>> >>>>>>>> The way I see this is to have something like that (all in one): >>>>>>>> >>>>>>>> >>>>>>>> mod_405=my_405_handle_module >>>>>>>> .... >>>>>>>> >>>>>>>> >>>>>>>> in this way we can also customize the response if a method other >>>>>>>> than GET or POST is sent to the server >>>>>>>> >>>>>>>> On Fri, Feb 13, 2015 at 10:17 AM, Imants Cekusins >>>>>>> > wrote: >>>>>>>> >>>>>>>>> > Traffic with methods not allowed should be discarded with 405 >>>>>>>>> >>>>>>>>> you see, someone else might prefer another action depending on >>>>>>>>> method >>>>>>>>> not allowed. >>>>>>>>> >>>>>>>>> a dedicated attribute may be convenient but then someone would ask: >>>>>>>>> "how do I change the response code? how do I redirect?". Current >>>>>>>>> approach gives you choice. >>>>>>>>> >>>>>>>>> one of those cases when there is more than one approach, a >>>>>>>>> prefers A, >>>>>>>>> b prefers B. Both have a valid point. >>>>>>>>> >>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From vinoski@REDACTED Tue Jun 30 14:36:20 2015 From: vinoski@REDACTED (Steve Vinoski) Date: Tue, 30 Jun 2015 08:36:20 -0400 Subject: [erlang-questions] configure http methods in yaws In-Reply-To: References: Message-ID: On Tue, Jun 30, 2015 at 6:38 AM, Bogdan Andu wrote: > I know intercept module does not have clidata populated. > > I was saying that in dispatch module I want POST data. > > In a configuration like this: > > .... > > port = 8088 > listen = 127.0.0.1 > listen_backlog = 100 > dispatchmod = dispatch_rewrite > docroot = /tmp > revproxy = / http://127.0.0.1:8080/ intercept_mod intercept_cgi > > > I thought dispatch_rewrite to give me clidata, but clidata for a POST > to a cgi script remains undefined. > As its name implies, a dispatch module is useful when you're taking over dispatching from Yaws. For example, I've used it for a video delivery application and for integrating webmachine and Yaws, the latter because webmachine already performs all its own request processing and reply delivery. For the dispatchmod case Yaws reads just enough of the request to build a minimal #arg{} and assumes the dispatch module will handle the rest, including reading additional data from the socket when warranted, so if your dispatchmod is expecting POSTs, it will have to handle them itself. --steve > > Thanks, > Bogdan > > > On Mon, Jun 29, 2015 at 8:48 PM, Steve Vinoski wrote: > >> >> >> On Mon, Jun 29, 2015 at 11:10 AM, Bogdan Andu wrote: >> >>> Thanks for reply. >>> >>> I tested myself yaws in revproxy and >>> I like it. >>> >>> Although I don't know how to capture POST data >>> which should be present in Arg#arg.clidata field >>> which is also undefined. >>> >>> I searched the web and docs and found nothing. >>> >>> I wrongly assumed that field Arg#arg.querydata hold POST data >>> >>> I want POST data to apply some regular expression checks >>> (like mod_rewrite in Apache) on them >>> >> >> Pretty sure an intercept_mod has access only to information about the >> request, and to the headers. The revproxy code uses an internal state >> record to track details about POST data and such, but an intercept mod >> doesn't have access to that state. You might consider posting an issue to >> the yaws github project (https://github.com/klacke/yaws) to see if this >> functionality can be added. >> >> --steve >> >> >> >>> Thanks, >>> Bogdan >>> >>> >>> On Mon, Jun 29, 2015 at 5:49 PM, Steve Vinoski wrote: >>> >>>> >>>> >>>> On Sun, Jun 28, 2015 at 11:20 AM, Bogdan Andu wrote: >>>> >>>>> Hi, >>>>> >>>>> I know the docs >>>>> and I run internally Yaws in reverse proxy mode >>>>> and I want this in Internet facing setup also >>>>> >>>>> I searched the net 'yaws reverse proxy' and I found: >>>>> >>>>> 1) >>>>> http://stackoverflow.com/questions/917546/has-anybody-used-yaws-server-as-an-http-proxy >>>>> although 6 years old, is Yaws in reverse proxy mode comparable or >>>>> even >>>>> better than varnis, haproxy, nginx? >>>>> >>>> >>>> That question/answer is out of date, since revproxy code was largely >>>> refactored in the 2012-2014 timeframe. >>>> >>>> >>>>> 2) http://osdir.com/ml/web.server.yaws.general/2007-12/msg00000.html >>>>> this one is from klacke and he speaks about difficulties he >>>>> encountered writing revproxy engine.as well as an OTP limitation >>>>> being the main obstacle in overcoming these. >>>>> Are these still apply today? >>>>> >>>> >>>> Probably not, given the rewrite. >>>> >>>> >>>>> 3) also found this: >>>>> http://www.erlang-factory.com/upload/presentations/752/reed-efsf2013-whatsapp.pdf >>>>> it seems whatsapp useses or used yaws in revproxy mode with some >>>>> tweaks >>>>> >>>>> The setup I want is simple: >>>>> >>>>> Because I have the applications written in other language >>>>> and for rewriting them in Erlang I dont have the time I must >>>>> use this setup: >>>>> >>>>> - Yaws in front-end in revproxy mode with interception module with >>>>> plenty of check >>>>> on headers, cookies, etc >>>>> - Twiggy/Starlet/Starman as back-end or psgi server >>>>> more info here: >>>>> http://www.slideshare.net/kazeburo/yapc2013psgi-plack >>>>> >>>>> I want to keepalive connections between yaws and psgi servers to avoid >>>>> 3-way handshake overhead. Although with outside world I want disable >>>>> keepalive >>>>> and set 'connection: close' and all of thiese can be done by >>>>> altering the headers >>>>> tru interception module. >>>>> >>>>> >>>>> Is it safe to keepalive connections between Yaws and Twiggy for >>>>> example which is an Libevent implementation web server? >>>>> Or Starlet/Starman like web server which has a parallel pre-fork model? >>>>> >>>> >>>> Seems like it should be OK but I've never used the backend servers >>>> you're talking about, so I can't say for sure whether it's safe or not. You >>>> might try asking on the erlyaws mailing list (see >>>> https://lists.sourceforge.net/lists/listinfo/erlyaws-list). >>>> >>>> --steve >>>> >>>> >>>> >>>>> Thanks and sorry for long post, >>>>> >>>>> Bogdan >>>>> >>>>> >>>>> >>>>> >>>>> On Sun, Jun 28, 2015 at 4:51 AM, Steve Vinoski >>>>> wrote: >>>>> >>>>>> >>>>>> >>>>>> On Sat, Jun 27, 2015 at 4:58 AM, Bogdan Andu >>>>>> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> About yaws as reverse proxy.. >>>>>>> >>>>>>> I want to use yaws as a reverse proxy in a >>>>>>> http -> http setup. no ssl involved whatsoever. >>>>>>> >>>>>>> I am interested in interception module where I want >>>>>>> to apply various checks on headers, query string, etc >>>>>>> making this some kind of www firewall . >>>>>>> >>>>>>> Is this feature of yaws production ready ? >>>>>>> >>>>>> >>>>>> Yes. You can find details about it in chapter 13 of >>>>>> http://yaws.hyber.org/yaws.pdf, or under the revproxy section of >>>>>> http://yaws.hyber.org/yman.yaws?page=yaws.conf . >>>>>> >>>>>> --steve >>>>>> >>>>>> >>>>>> >>>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> Bogdan >>>>>>> >>>>>>> >>>>>>> On Fri, Feb 13, 2015 at 6:14 PM, Steve Vinoski >>>>>>> wrote: >>>>>>> >>>>>>>> I don't recall seeing Yaws users asking for this config feature in >>>>>>>> the past, so it's unlikely we'll add it. But what you're asking for -- a >>>>>>>> configuration point for methods -- would be implemented much as I've shown >>>>>>>> in my previous emails, much like a dispatchmod. The dispatchmod is as early >>>>>>>> in the request handling process as you can get after the formation of the >>>>>>>> #arg{}. The dispatchmod code I provided requires less configuration than >>>>>>>> what you're showing, even for the default case, plus if having to have a >>>>>>>> new module concerns you, the dispatch/1 function can be added to some other >>>>>>>> existing module you already have instead. >>>>>>>> >>>>>>>> --steve >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On Fri, Feb 13, 2015 at 4:30 AM, Bogdan Andu >>>>>>>> wrote: >>>>>>>> >>>>>>>>> Yes but the point is to have a default configuration that can be >>>>>>>>> overridden by such a mechanism >>>>>>>>> if one is configured. >>>>>>>>> The 99 percent of cases only need a default behaviour. >>>>>>>>> >>>>>>>>> The way I see this is to have something like that (all in one): >>>>>>>>> >>>>>>>>> >>>>>>>>> mod_405=my_405_handle_module >>>>>>>>> .... >>>>>>>>> >>>>>>>>> >>>>>>>>> in this way we can also customize the response if a method other >>>>>>>>> than GET or POST is sent to the server >>>>>>>>> >>>>>>>>> On Fri, Feb 13, 2015 at 10:17 AM, Imants Cekusins < >>>>>>>>> imantc@REDACTED> wrote: >>>>>>>>> >>>>>>>>>> > Traffic with methods not allowed should be discarded with 405 >>>>>>>>>> >>>>>>>>>> you see, someone else might prefer another action depending on >>>>>>>>>> method >>>>>>>>>> not allowed. >>>>>>>>>> >>>>>>>>>> a dedicated attribute may be convenient but then someone would >>>>>>>>>> ask: >>>>>>>>>> "how do I change the response code? how do I redirect?". Current >>>>>>>>>> approach gives you choice. >>>>>>>>>> >>>>>>>>>> one of those cases when there is more than one approach, a >>>>>>>>>> prefers A, >>>>>>>>>> b prefers B. Both have a valid point. >>>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hugo@REDACTED Tue Jun 30 16:10:10 2015 From: hugo@REDACTED (Hugo Mills) Date: Tue, 30 Jun 2015 14:10:10 +0000 Subject: [erlang-questions] yecc and compiler warnings In-Reply-To: <20150629174444.GB3076@carfax.org.uk> References: <20150629174444.GB3076@carfax.org.uk> Message-ID: <20150630141010.GD3076@carfax.org.uk> On Mon, Jun 29, 2015 at 05:44:44PM +0000, Hugo Mills wrote: > I'm writing a small domain-specific language using leex and yecc > (under R17 at the moment), and I'm getting a bunch of these from the > module produced by yecc: > > ebin/linseed_parser.erl:409: Warning: function yeccpars2_3/7 is unused > ebin/linseed_parser.erl:808: Warning: function yeccpars2_87/7 is unused > ebin/linseed_parser.erl:822: Warning: function yeccpars2_89/7 is unused > ebin/linseed_parser.erl:827: Warning: function yeccpars2_90/7 is unused > ebin/linseed_parser.erl:949: Warning: function yeccgoto_line_sequence/7 is unused > src/linseed_parser.yrl:20: Warning: function yeccpars2_89_/1 is unused > src/linseed_parser.yrl:22: Warning: function yeccpars2_90_/1 is unused > src/linseed_parser.yrl:27: Warning: function yeccpars2_87_/1 is unused > > The latter three lines (linseed_parser.yrl:20 and so on) do not > seem to correspond to anything sensible in linseed_parser.yrl: line 20 > is empty, line 22 is the first line of a production, and line 27 is > the second line of a different production. > > Are these warnings expected from using yecc, or is there something > wrong with my grammar? If the latter, how do I identify what it is > from the warning messages above? I think I've worked this out, eventually. To answer the question for posterity, my grammar doesn't have an explicit terminating symbol, so I removed the "Endsymbol" line from the yecc file. After doing that, the unused functions vanished, and I get a clean compile of the parser. Hugo. -- Hugo Mills | ?1973 Unclear Research Ltd hugo@REDACTED carfax.org.uk | http://carfax.org.uk/ | PGP: E2AB1DE4 | -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: From sverker.eriksson@REDACTED Tue Jun 30 16:46:29 2015 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Tue, 30 Jun 2015 16:46:29 +0200 Subject: [erlang-questions] Patch package OTP 17.5.6.1 released Message-ID: <5592ABC5.8000106@ericsson.com> Patch Package: OTP 17.5.6.1 Git Tag: OTP-17.5.6.1 Date: 2015-06-29 Trouble Report Id: OTP-12821, OTP-12859 Seq num: seq12882 System: OTP Release: 17 Application: erts-6.4.1.1 Predecessor: OTP 17.5.6 Check out the git tag OTP-17.5.6.1, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- erts-6.4.1.1 ---------------------------------------------------- --------------------------------------------------------------------- The erts-6.4.1.1 application can be applied independently of other applications on a full OTP 17 installation. --- Fixed Bugs and Malfunctions --- OTP-12821 Application(s): erts Fix garbage collection of literals in code purge During code purging and check_process_code, the checking of the binary reference embedded in the match binary state was omitted for the tracing tests. This would cause the binary match state to reference deallocated memory. OTP-12859 Application(s): erts Related Id(s): seq12882 Fix a rare hanging of the VM seen to happen just after emulator start. Bug exists since R14. Full runtime dependencies of erts-6.4.1.1: kernel-3.0, sasl-2.4, stdlib-2.0 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From sverker.eriksson@REDACTED Tue Jun 30 16:47:46 2015 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Tue, 30 Jun 2015 16:47:46 +0200 Subject: [erlang-questions] Patch package OTP 18.0.1 released Message-ID: <5592AC12.7070500@ericsson.com> Patch Package: OTP 18.0.1 Git Tag: OTP-18.0.1 Date: 2015-06-30 Trouble Report Id: OTP-12859 Seq num: seq12882 System: OTP Release: 18 Application: erts-7.0.1 Predecessor: OTP 18.0 Check out the git tag OTP-18.0.1, and build a full OTP system including documentation. Apply one or more applications from this build as patches to your installation using the 'otp_patch_apply' tool. For information on install requirements, see descriptions for each application version below. --------------------------------------------------------------------- --- erts-7.0.1 ------------------------------------------------------ --------------------------------------------------------------------- The erts-7.0.1 application can be applied independently of other applications on a full OTP 18 installation. --- Fixed Bugs and Malfunctions --- OTP-12859 Application(s): erts Related Id(s): seq12882 Fix a rare hanging of the VM seen to happen just after emulator start. Bug exists since R14. Full runtime dependencies of erts-7.0.1: kernel-4.0, sasl-2.4, stdlib-2.5 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From bog495@REDACTED Tue Jun 30 17:09:53 2015 From: bog495@REDACTED (Bogdan Andu) Date: Tue, 30 Jun 2015 18:09:53 +0300 Subject: [erlang-questions] configure http methods in yaws In-Reply-To: References: Message-ID: It is intended this behavior and only the headers are read and only a part of them because neither query params of a GET are not read fro socket. So, basically the body is not read in a dispatchmod, right? Only a part of the headers. Or all? And then in dispatchmod how do I know there are unparsed headers or not to know exactly when to parse the body of the request ? Thanks, Bogdan On Tue, Jun 30, 2015 at 3:36 PM, Steve Vinoski wrote: > > > On Tue, Jun 30, 2015 at 6:38 AM, Bogdan Andu wrote: > >> I know intercept module does not have clidata populated. >> >> I was saying that in dispatch module I want POST data. >> >> In a configuration like this: >> >> .... >> >> port = 8088 >> listen = 127.0.0.1 >> listen_backlog = 100 >> dispatchmod = dispatch_rewrite >> docroot = /tmp >> revproxy = / http://127.0.0.1:8080/ intercept_mod intercept_cgi >> >> >> I thought dispatch_rewrite to give me clidata, but clidata for a POST >> to a cgi script remains undefined. >> > > As its name implies, a dispatch module is useful when you're taking over > dispatching from Yaws. For example, I've used it for a video delivery > application and for integrating webmachine and Yaws, the latter because > webmachine already performs all its own request processing and reply > delivery. For the dispatchmod case Yaws reads just enough of the request to > build a minimal #arg{} and assumes the dispatch module will handle the > rest, including reading additional data from the socket when warranted, so > if your dispatchmod is expecting POSTs, it will have to handle them itself. > > --steve > > > >> >> Thanks, >> Bogdan >> >> >> On Mon, Jun 29, 2015 at 8:48 PM, Steve Vinoski wrote: >> >>> >>> >>> On Mon, Jun 29, 2015 at 11:10 AM, Bogdan Andu wrote: >>> >>>> Thanks for reply. >>>> >>>> I tested myself yaws in revproxy and >>>> I like it. >>>> >>>> Although I don't know how to capture POST data >>>> which should be present in Arg#arg.clidata field >>>> which is also undefined. >>>> >>>> I searched the web and docs and found nothing. >>>> >>>> I wrongly assumed that field Arg#arg.querydata hold POST data >>>> >>>> I want POST data to apply some regular expression checks >>>> (like mod_rewrite in Apache) on them >>>> >>> >>> Pretty sure an intercept_mod has access only to information about the >>> request, and to the headers. The revproxy code uses an internal state >>> record to track details about POST data and such, but an intercept mod >>> doesn't have access to that state. You might consider posting an issue to >>> the yaws github project (https://github.com/klacke/yaws) to see if this >>> functionality can be added. >>> >>> --steve >>> >>> >>> >>>> Thanks, >>>> Bogdan >>>> >>>> >>>> On Mon, Jun 29, 2015 at 5:49 PM, Steve Vinoski >>>> wrote: >>>> >>>>> >>>>> >>>>> On Sun, Jun 28, 2015 at 11:20 AM, Bogdan Andu >>>>> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I know the docs >>>>>> and I run internally Yaws in reverse proxy mode >>>>>> and I want this in Internet facing setup also >>>>>> >>>>>> I searched the net 'yaws reverse proxy' and I found: >>>>>> >>>>>> 1) >>>>>> http://stackoverflow.com/questions/917546/has-anybody-used-yaws-server-as-an-http-proxy >>>>>> although 6 years old, is Yaws in reverse proxy mode comparable or >>>>>> even >>>>>> better than varnis, haproxy, nginx? >>>>>> >>>>> >>>>> That question/answer is out of date, since revproxy code was largely >>>>> refactored in the 2012-2014 timeframe. >>>>> >>>>> >>>>>> 2) http://osdir.com/ml/web.server.yaws.general/2007-12/msg00000.html >>>>>> this one is from klacke and he speaks about difficulties he >>>>>> encountered writing revproxy engine.as well as an OTP limitation >>>>>> being the main obstacle in overcoming these. >>>>>> Are these still apply today? >>>>>> >>>>> >>>>> Probably not, given the rewrite. >>>>> >>>>> >>>>>> 3) also found this: >>>>>> http://www.erlang-factory.com/upload/presentations/752/reed-efsf2013-whatsapp.pdf >>>>>> it seems whatsapp useses or used yaws in revproxy mode with some >>>>>> tweaks >>>>>> >>>>>> The setup I want is simple: >>>>>> >>>>>> Because I have the applications written in other language >>>>>> and for rewriting them in Erlang I dont have the time I must >>>>>> use this setup: >>>>>> >>>>>> - Yaws in front-end in revproxy mode with interception module with >>>>>> plenty of check >>>>>> on headers, cookies, etc >>>>>> - Twiggy/Starlet/Starman as back-end or psgi server >>>>>> more info here: >>>>>> http://www.slideshare.net/kazeburo/yapc2013psgi-plack >>>>>> >>>>>> I want to keepalive connections between yaws and psgi servers to >>>>>> avoid >>>>>> 3-way handshake overhead. Although with outside world I want disable >>>>>> keepalive >>>>>> and set 'connection: close' and all of thiese can be done by >>>>>> altering the headers >>>>>> tru interception module. >>>>>> >>>>>> >>>>>> Is it safe to keepalive connections between Yaws and Twiggy for >>>>>> example which is an Libevent implementation web server? >>>>>> Or Starlet/Starman like web server which has a parallel pre-fork >>>>>> model? >>>>>> >>>>> >>>>> Seems like it should be OK but I've never used the backend servers >>>>> you're talking about, so I can't say for sure whether it's safe or not. You >>>>> might try asking on the erlyaws mailing list (see >>>>> https://lists.sourceforge.net/lists/listinfo/erlyaws-list). >>>>> >>>>> --steve >>>>> >>>>> >>>>> >>>>>> Thanks and sorry for long post, >>>>>> >>>>>> Bogdan >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> On Sun, Jun 28, 2015 at 4:51 AM, Steve Vinoski >>>>>> wrote: >>>>>> >>>>>>> >>>>>>> >>>>>>> On Sat, Jun 27, 2015 at 4:58 AM, Bogdan Andu >>>>>>> wrote: >>>>>>> >>>>>>>> Hi, >>>>>>>> >>>>>>>> About yaws as reverse proxy.. >>>>>>>> >>>>>>>> I want to use yaws as a reverse proxy in a >>>>>>>> http -> http setup. no ssl involved whatsoever. >>>>>>>> >>>>>>>> I am interested in interception module where I want >>>>>>>> to apply various checks on headers, query string, etc >>>>>>>> making this some kind of www firewall . >>>>>>>> >>>>>>>> Is this feature of yaws production ready ? >>>>>>>> >>>>>>> >>>>>>> Yes. You can find details about it in chapter 13 of >>>>>>> http://yaws.hyber.org/yaws.pdf, or under the revproxy section of >>>>>>> http://yaws.hyber.org/yman.yaws?page=yaws.conf . >>>>>>> >>>>>>> --steve >>>>>>> >>>>>>> >>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Bogdan >>>>>>>> >>>>>>>> >>>>>>>> On Fri, Feb 13, 2015 at 6:14 PM, Steve Vinoski >>>>>>>> wrote: >>>>>>>> >>>>>>>>> I don't recall seeing Yaws users asking for this config feature in >>>>>>>>> the past, so it's unlikely we'll add it. But what you're asking for -- a >>>>>>>>> configuration point for methods -- would be implemented much as I've shown >>>>>>>>> in my previous emails, much like a dispatchmod. The dispatchmod is as early >>>>>>>>> in the request handling process as you can get after the formation of the >>>>>>>>> #arg{}. The dispatchmod code I provided requires less configuration than >>>>>>>>> what you're showing, even for the default case, plus if having to have a >>>>>>>>> new module concerns you, the dispatch/1 function can be added to some other >>>>>>>>> existing module you already have instead. >>>>>>>>> >>>>>>>>> --steve >>>>>>>>> >>>>>>>>> >>>>>>>>> >>>>>>>>> On Fri, Feb 13, 2015 at 4:30 AM, Bogdan Andu >>>>>>>>> wrote: >>>>>>>>> >>>>>>>>>> Yes but the point is to have a default configuration that can be >>>>>>>>>> overridden by such a mechanism >>>>>>>>>> if one is configured. >>>>>>>>>> The 99 percent of cases only need a default behaviour. >>>>>>>>>> >>>>>>>>>> The way I see this is to have something like that (all in one): >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> mod_405=my_405_handle_module >>>>>>>>>> .... >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> in this way we can also customize the response if a method other >>>>>>>>>> than GET or POST is sent to the server >>>>>>>>>> >>>>>>>>>> On Fri, Feb 13, 2015 at 10:17 AM, Imants Cekusins < >>>>>>>>>> imantc@REDACTED> wrote: >>>>>>>>>> >>>>>>>>>>> > Traffic with methods not allowed should be discarded with 405 >>>>>>>>>>> >>>>>>>>>>> you see, someone else might prefer another action depending on >>>>>>>>>>> method >>>>>>>>>>> not allowed. >>>>>>>>>>> >>>>>>>>>>> a dedicated attribute may be convenient but then someone would >>>>>>>>>>> ask: >>>>>>>>>>> "how do I change the response code? how do I redirect?". Current >>>>>>>>>>> approach gives you choice. >>>>>>>>>>> >>>>>>>>>>> one of those cases when there is more than one approach, a >>>>>>>>>>> prefers A, >>>>>>>>>>> b prefers B. Both have a valid point. >>>>>>>>>>> >>>>>>>>>> >>>>>>>>>> >>>>>>>>> >>>>>>>> >>>>>>> >>>>>> >>>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mremond@REDACTED Tue Jun 30 18:22:09 2015 From: mremond@REDACTED (=?utf-8?b?TWlja2HDq2wgUsOpbW9uZA==?=) Date: Tue, 30 Jun 2015 18:22:09 +0200 Subject: [erlang-questions] Advanced Erlang Initiative Message-ID: <1E1D1D74-0A6F-4DA5-9244-8AD88B368547@process-one.net> Hello, We are proud to be launching the Advanced Erlang Initiative, a new group of companies that use Erlang as a strategic technology to craft great products. Erlang ecosystems rely on those publishers that are producing person/years worth of code to build excellent products. The Advanced Erlang Initiative recognises that those products in turn contribute to the fame of the Erlang platform. They help pushing the limits and contribute to the fame of our beloved programming language. Most of all, the Advanced Erlang Initiative acknowledges peoples energy and effort put in those great products to the good of every Erlang developer. We have created a forum for developers working with and contributing to those tools to meet and discuss their work. The Advanced Erlang Initiative welcomes all developers that share our passion for Erlang, Elixir, the beam environment and our vision of technical excellence. Our initiative is primarily centered around inexpensive highly technical workshops given around the world and educational videos on our Erlang products. The first two members are: - ProcessOne, maker of the world class messaging server ejabberd, since 2002. - Quviq, maker of the Quickcheck property-based testing tool, innovation in quality assurance. We are happy to meet you on the newly launched website: http://advanced-erlang.com We are already taking registration for the first two workshops directly from the site: - Quickcheck workshop: 2015, October 6th in Gothenburg, Sweden - ejabberd workshop: 2015, november 17th - Paris, France Enjoy and see you there after the summer break ! -- Thomas Arts, Quviq Micka?l R?mond, ProcessOne -------------- next part -------------- An HTML attachment was scrubbed... URL: From tony@REDACTED Tue Jun 30 21:05:10 2015 From: tony@REDACTED (Tony Rogvall) Date: Tue, 30 Jun 2015 21:05:10 +0200 Subject: [erlang-questions] Advanced Erlang Initiative In-Reply-To: <1E1D1D74-0A6F-4DA5-9244-8AD88B368547@process-one.net> References: <1E1D1D74-0A6F-4DA5-9244-8AD88B368547@process-one.net> Message-ID: <1B9593F1-1F62-45FF-92FA-DDE5D31F00D8@rogvall.se> That?s the spirit! Congrats to a really good initiative! /Tony > On 30 jun 2015, at 18:22, Micka?l R?mond wrote: > > Hello, > > We are proud to be launching the Advanced Erlang Initiative, a new group of companies that use Erlang as a strategic technology to craft great products. Erlang ecosystems rely on those publishers that are producing person/years worth of code to build excellent products. > > The Advanced Erlang Initiative recognises that those products in turn contribute to the fame of the Erlang platform. They help pushing the limits and contribute to the fame of our beloved programming language. Most of all, the Advanced Erlang Initiative acknowledges peoples energy and effort put in those great products to the good of every Erlang developer. We have created a forum for developers working with and contributing to those tools to meet and discuss their work. > > The Advanced Erlang Initiative welcomes all developers that share our passion for Erlang, Elixir, the beam environment and our vision of technical excellence. > Our initiative is primarily centered around inexpensive highly technical workshops given around the world and educational videos on our Erlang products. > > The first two members are: > > ProcessOne, maker of the world class messaging server ejabberd, since 2002. > Quviq, maker of the Quickcheck property-based testing tool, innovation in quality assurance. > We are happy to meet you on the newly launched website: http://advanced-erlang.com > We are already taking registration for the first two workshops directly from the site: > > Quickcheck workshop: 2015, October 6th in Gothenburg, Sweden > ejabberd workshop: 2015, november 17th - Paris, France > Enjoy and see you there after the summer break ! > > -- > Thomas Arts, Quviq > Micka?l R?mond, ProcessOne > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: Message signed with OpenPGP using GPGMail URL: