From comptekki@REDACTED Sun Jul 1 00:05:04 2018 From: comptekki@REDACTED (Wes James) Date: Sat, 30 Jun 2018 16:05:04 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release Message-ID: I upgraded to erlang 21.0.1 and upgraded rebar3 to the latest and built my project, but when I ran it I got an erlexec permissions denied error. I noticed that most of the files in _rel/project_name/erts-10.0.1/bin were set only rw not rwx. Is this a bug or do I need to change a setting somewhere? This is when I run: _rel/bin/project_name console Thanks, -wes -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Sun Jul 1 00:14:03 2018 From: t@REDACTED (Tristan Sloughter) Date: Sat, 30 Jun 2018 16:14:03 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: References: Message-ID: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> This is with rebar3 3.6.1? Why is it under `_rel`? Did you set a different output directory or are you using relx directly? In which case make sure you have version 3.26.0. Tristan On Sat, Jun 30, 2018, at 4:05 PM, Wes James wrote: > I upgraded to erlang 21.0.1 and upgraded rebar3 to the latest and > built my project, but when I ran it I got an erlexec permissions > denied error. I noticed that most of the files in _rel/project_name/erts- > 10.0.1/bin were set only rw not rwx. Is this a bug or do I need to > change a setting somewhere?> > This is when I run: _rel/bin/project_name console > > Thanks, > > -wes > _________________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Sun Jul 1 00:16:27 2018 From: comptekki@REDACTED (Wes James) Date: Sat, 30 Jun 2018 16:16:27 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> Message-ID: OK. I thought I got the latest yesterday. I'll check again. On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter wrote: > This is with rebar3 3.6.1? Why is it under `_rel`? Did you set a different > output directory or are you using relx directly? In which case make sure > you have version 3.26.0. > > Tristan > > On Sat, Jun 30, 2018, at 4:05 PM, Wes James wrote: > > I upgraded to erlang 21.0.1 and upgraded rebar3 to the latest and built my > project, but when I ran it I got an erlexec permissions denied error. I > noticed that most of the files in _rel/project_name/erts-10.0.1/bin were > set only rw not rwx. Is this a bug or do I need to change a setting > somewhere? > > This is when I run: _rel/bin/project_name console > > Thanks, > > -wes > *_______________________________________________* > 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 comptekki@REDACTED Sun Jul 1 00:20:52 2018 From: comptekki@REDACTED (Wes James) Date: Sat, 30 Jun 2018 16:20:52 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> Message-ID: I have 3.26.0. On Sat, Jun 30, 2018 at 4:16 PM, Wes James wrote: > OK. I thought I got the latest yesterday. I'll check again. > > On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter > wrote: > >> This is with rebar3 3.6.1? Why is it under `_rel`? Did you set a >> different output directory or are you using relx directly? In which case >> make sure you have version 3.26.0. >> >> Tristan >> >> On Sat, Jun 30, 2018, at 4:05 PM, Wes James wrote: >> >> I upgraded to erlang 21.0.1 and upgraded rebar3 to the latest and built >> my project, but when I ran it I got an erlexec permissions denied error. I >> noticed that most of the files in _rel/project_name/erts-10.0.1/bin were >> set only rw not rwx. Is this a bug or do I need to change a setting >> somewhere? >> >> This is when I run: _rel/bin/project_name console >> >> Thanks, >> >> -wes >> *_______________________________________________* >> 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 comptekki@REDACTED Sun Jul 1 00:27:37 2018 From: comptekki@REDACTED (Wes James) Date: Sat, 30 Jun 2018 16:27:37 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> Message-ID: I thought relx was just another name for rebar. I'm using erlang.mk and it has relx in the script. I'm seeing these 2: https://github.com/erlang/rebar3 https://github.com/erlware/relx On Sat, Jun 30, 2018 at 4:20 PM, Wes James wrote: > I have 3.26.0. > > On Sat, Jun 30, 2018 at 4:16 PM, Wes James wrote: > >> OK. I thought I got the latest yesterday. I'll check again. >> >> On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter >> wrote: >> >>> This is with rebar3 3.6.1? Why is it under `_rel`? Did you set a >>> different output directory or are you using relx directly? In which case >>> make sure you have version 3.26.0. >>> >>> Tristan >>> >>> On Sat, Jun 30, 2018, at 4:05 PM, Wes James wrote: >>> >>> I upgraded to erlang 21.0.1 and upgraded rebar3 to the latest and built >>> my project, but when I ran it I got an erlexec permissions denied error. I >>> noticed that most of the files in _rel/project_name/erts-10.0.1/bin >>> were set only rw not rwx. Is this a bug or do I need to change a setting >>> somewhere? >>> >>> This is when I run: _rel/bin/project_name console >>> >>> Thanks, >>> >>> -wes >>> *_______________________________________________* >>> 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 t@REDACTED Sun Jul 1 00:31:56 2018 From: t@REDACTED (Tristan Sloughter) Date: Sat, 30 Jun 2018 16:31:56 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> Message-ID: <1530397916.3145934.1425928400.59388CC9@webmail.messagingengine.com> relx and rebar3 are separate tools, but rebar3 includes relx for building releases. rebar3 builds applications, runs tests and handles dependencies, relx only does release creation. So if you download rebar3 you are getting relx but not the other way around, so if you are using erlang.mk you are only using relx. Tristan On Sat, Jun 30, 2018, at 4:27 PM, Wes James wrote: > I thought relx was just another name for rebar. I'm using erlang.mk > and it has relx in the script.> > I'm seeing these 2: > > https://github.com/erlang/rebar3 > > https://github.com/erlware/relx > > On Sat, Jun 30, 2018 at 4:20 PM, Wes James > wrote:>> I have 3.26.0. >> >> On Sat, Jun 30, 2018 at 4:16 PM, Wes James >> wrote:>>> OK. I thought I got the latest yesterday. I'll check again. >>> >>> On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter >>> wrote:>>>> __ >>>> This is with rebar3 3.6.1? Why is it under `_rel`? Did you set a >>>> different output directory or are you using relx directly? In which >>>> case make sure you have version 3.26.0.>>>> >>>> Tristan >>>> >>>> On Sat, Jun 30, 2018, at 4:05 PM, Wes James wrote: >>>>> I upgraded to erlang 21.0.1 and upgraded rebar3 to the latest and >>>>> built my project, but when I ran it I got an erlexec permissions >>>>> denied error. I noticed that most of the files in _rel/project_name/erts- >>>>> 10.0.1/bin were set only rw not rwx. Is this a bug or do I need >>>>> to change a setting somewhere?>>>>> >>>>> This is when I run: _rel/bin/project_name console >>>>> >>>>> Thanks, >>>>> >>>>> -wes >>>>> _________________________________________________ >>>>> 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 comptekki@REDACTED Sun Jul 1 00:35:30 2018 From: comptekki@REDACTED (Wes James) Date: Sat, 30 Jun 2018 16:35:30 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: <1530397916.3145934.1425928400.59388CC9@webmail.messagingengine.com> References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> <1530397916.3145934.1425928400.59388CC9@webmail.messagingengine.com> Message-ID: OK. Thanks. On Sat, Jun 30, 2018 at 4:31 PM, Tristan Sloughter wrote: > relx and rebar3 are separate tools, but rebar3 includes relx for building > releases. rebar3 builds applications, runs tests and handles dependencies, > relx only does release creation. > > So if you download rebar3 you are getting relx but not the other way > around, so if you are using erlang.mk you are only using relx. > > Tristan > > On Sat, Jun 30, 2018, at 4:27 PM, Wes James wrote: > > I thought relx was just another name for rebar. I'm using erlang.mk and > it has relx in the script. > > I'm seeing these 2: > > https://github.com/erlang/rebar3 > > https://github.com/erlware/relx > > On Sat, Jun 30, 2018 at 4:20 PM, Wes James wrote: > > I have 3.26.0. > > On Sat, Jun 30, 2018 at 4:16 PM, Wes James wrote: > > OK. I thought I got the latest yesterday. I'll check again. > > On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter > wrote: > > > This is with rebar3 3.6.1? Why is it under `_rel`? Did you set a different > output directory or are you using relx directly? In which case make sure > you have version 3.26.0. > > Tristan > > On Sat, Jun 30, 2018, at 4:05 PM, Wes James wrote: > > I upgraded to erlang 21.0.1 and upgraded rebar3 to the latest and built my > project, but when I ran it I got an erlexec permissions denied error. I > noticed that most of the files in _rel/project_name/erts-10.0.1/bin were > set only rw not rwx. Is this a bug or do I need to change a setting > somewhere? > > This is when I run: _rel/bin/project_name console > > Thanks, > > -wes > *_______________________________________________* > 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 comptekki@REDACTED Sun Jul 1 00:49:24 2018 From: comptekki@REDACTED (Wes James) Date: Sat, 30 Jun 2018 16:49:24 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: <1530397916.3145934.1425928400.59388CC9@webmail.messagingengine.com> References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> <1530397916.3145934.1425928400.59388CC9@webmail.messagingengine.com> Message-ID: I downloaded relx and built it and put it in to my project and then built my project. The folders look like this: $ ls -al /usr/local/lib/erlang/erts-10.0.1/bin total 20204 drwxr-xr-x. 2 root root 4096 Jun 29 14:55 . drwxr-xr-x. 8 root root 70 Jun 29 14:55 .. -rwxr-xr-x. 1 root root 19177216 Jun 29 14:55 beam.smp -rwxr-xr-x. 1 root root 126704 Jun 29 14:55 ct_run -rwxr-xr-x. 1 root root 124296 Jun 29 14:55 dialyzer -rwxr-xr-x. 1 root root 30008 Jun 29 14:55 dyn_erl -rwxr-xr-x. 1 root root 214632 Jun 29 14:55 epmd -rwxr-xr-x. 1 root root 857 Jun 29 14:55 erl -rwxr-xr-x. 1 root root 124088 Jun 29 14:55 erlc -rwxr-xr-x. 1 root root 60864 Jun 29 14:55 erl_child_setup -rwxr-xr-x. 1 root root 203776 Jun 29 14:55 erlexec -rwxr-xr-x. 1 root root 851 Jun 29 14:55 erl.src -rwxr-xr-x. 1 root root 127648 Jun 29 14:55 escript -rwxr-xr-x. 1 root root 31824 Jun 29 14:55 heart -rwxr-xr-x. 1 root root 181304 Jun 29 14:55 inet_gethost -rwxr-xr-x. 1 root root 78160 Jun 29 14:55 run_erl -rwxr-xr-x. 1 root root 1154 Jun 29 14:55 start -rwxr-xr-x. 1 root root 1244 Jun 29 14:55 start_erl.src -rwxr-xr-x. 1 root root 1148 Jun 29 14:55 start.src -rwxr-xr-x. 1 root root 37216 Jun 29 14:55 to_erl -rwxr-xr-x. 1 root root 118232 Jun 29 14:55 typer After building with relx: ls -al _rel/project/erts-10.0.1/bin/ total 20228 drwxrwxr-x. 2 user user 4096 Jun 30 16:39 . drwxrwxr-x. 8 user user 70 Jun 30 16:39 .. -rw-rw-r--. 1 user user 19177216 Jun 30 16:39 beam.smp -rw-rw-r--. 1 user user 126704 Jun 30 16:39 ct_run -rw-rw-r--. 1 user user 124296 Jun 30 16:39 dialyzer -rw-rw-r--. 1 user user 30008 Jun 30 16:39 dyn_erl -rw-rw-r--. 1 user user 214632 Jun 30 16:39 epmd -rwxr-xr-x. 1 user user 248 Jun 30 16:39 erl -rw-rw-r--. 1 user user 124088 Jun 30 16:39 erlc -rw-rw-r--. 1 user user 60864 Jun 30 16:39 erl_child_setup -rw-rw-r--. 1 user user 203776 Jun 30 16:39 erlexec -rw-rw-r--. 1 user user 851 Jun 30 16:39 erl.src -rw-rw-r--. 1 user user 127648 Jun 30 16:39 escript -rw-rw-r--. 1 user user 31824 Jun 30 16:39 heart -rw-rw-r--. 1 user user 181304 Jun 30 16:39 inet_gethost -rwxr-xr-x. 1 user user 14037 Jun 30 16:39 install_upgrade.escript -rwxr-xr-x. 1 user user 6080 Jun 30 16:39 nodetool -rw-rw-r--. 1 user user 78160 Jun 30 16:39 run_erl -rw-rw-r--. 1 user user 1154 Jun 30 16:39 start -rw-rw-r--. 1 user user 1244 Jun 30 16:39 start_erl.src -rw-rw-r--. 1 user user 1148 Jun 30 16:39 start.src -rw-rw-r--. 1 user user 37216 Jun 30 16:39 to_erl -rw-rw-r--. 1 user user 118232 Jun 30 16:39 typer Only three of the copied files have x attribute. -wes On Sat, Jun 30, 2018 at 4:31 PM, Tristan Sloughter wrote: > relx and rebar3 are separate tools, but rebar3 includes relx for building > releases. rebar3 builds applications, runs tests and handles dependencies, > relx only does release creation. > > So if you download rebar3 you are getting relx but not the other way > around, so if you are using erlang.mk you are only using relx. > > Tristan > > On Sat, Jun 30, 2018, at 4:27 PM, Wes James wrote: > > I thought relx was just another name for rebar. I'm using erlang.mk and > it has relx in the script. > > I'm seeing these 2: > > https://github.com/erlang/rebar3 > > https://github.com/erlware/relx > > On Sat, Jun 30, 2018 at 4:20 PM, Wes James wrote: > > I have 3.26.0. > > On Sat, Jun 30, 2018 at 4:16 PM, Wes James wrote: > > OK. I thought I got the latest yesterday. I'll check again. > > On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter > wrote: > > > This is with rebar3 3.6.1? Why is it under `_rel`? Did you set a different > output directory or are you using relx directly? In which case make sure > you have version 3.26.0. > > Tristan > > On Sat, Jun 30, 2018, at 4:05 PM, Wes James wrote: > > I upgraded to erlang 21.0.1 and upgraded rebar3 to the latest and built my > project, but when I ran it I got an erlexec permissions denied error. I > noticed that most of the files in _rel/project_name/erts-10.0.1/bin were > set only rw not rwx. Is this a bug or do I need to change a setting > somewhere? > > This is when I run: _rel/bin/project_name console > > Thanks, > > -wes > *_______________________________________________* > 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 t@REDACTED Sun Jul 1 01:03:11 2018 From: t@REDACTED (Tristan Sloughter) Date: Sat, 30 Jun 2018 17:03:11 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> <1530397916.3145934.1425928400.59388CC9@webmail.messagingengine.com> Message-ID: <1530399791.3154127.1425941824.00814BA8@webmail.messagingengine.com> Did you verify that it is using the relx you copied over and not the one erlang.mk would have downloaded when you were building releases before? If it is indeed using 3.26.1 then please open an issue in the relx project on github. On Sat, Jun 30, 2018, at 4:49 PM, Wes James wrote: > I downloaded relx and built it and put it in to my project and then > built my project. The folders look like this:> > $ ls -al /usr/local/lib/erlang/erts-10.0.1/bin > total 20204 > drwxr-xr-x. 2 root root 4096 Jun 29 14:55 . > drwxr-xr-x. 8 root root 70 Jun 29 14:55 .. > -rwxr-xr-x. 1 root root 19177216 Jun 29 14:55 beam.smp > -rwxr-xr-x. 1 root root 126704 Jun 29 14:55 ct_run > -rwxr-xr-x. 1 root root 124296 Jun 29 14:55 dialyzer > -rwxr-xr-x. 1 root root 30008 Jun 29 14:55 dyn_erl > -rwxr-xr-x. 1 root root 214632 Jun 29 14:55 epmd > -rwxr-xr-x. 1 root root 857 Jun 29 14:55 erl > -rwxr-xr-x. 1 root root 124088 Jun 29 14:55 erlc > -rwxr-xr-x. 1 root root 60864 Jun 29 14:55 erl_child_setup > -rwxr-xr-x. 1 root root 203776 Jun 29 14:55 erlexec > -rwxr-xr-x. 1 root root 851 Jun 29 14:55 erl.src > -rwxr-xr-x. 1 root root 127648 Jun 29 14:55 escript > -rwxr-xr-x. 1 root root 31824 Jun 29 14:55 heart > -rwxr-xr-x. 1 root root 181304 Jun 29 14:55 inet_gethost > -rwxr-xr-x. 1 root root 78160 Jun 29 14:55 run_erl > -rwxr-xr-x. 1 root root 1154 Jun 29 14:55 start > -rwxr-xr-x. 1 root root 1244 Jun 29 14:55 start_erl.src > -rwxr-xr-x. 1 root root 1148 Jun 29 14:55 start.src > -rwxr-xr-x. 1 root root 37216 Jun 29 14:55 to_erl > -rwxr-xr-x. 1 root root 118232 Jun 29 14:55 typer > After building with relx: > > ls -al _rel/project/erts-10.0.1/bin/ > total 20228 > drwxrwxr-x. 2 user user 4096 Jun 30 16:39 . > drwxrwxr-x. 8 user user 70 Jun 30 16:39 .. > -rw-rw-r--. 1 user user 19177216 Jun 30 16:39 beam.smp > -rw-rw-r--. 1 user user 126704 Jun 30 16:39 ct_run > -rw-rw-r--. 1 user user 124296 Jun 30 16:39 dialyzer > -rw-rw-r--. 1 user user 30008 Jun 30 16:39 dyn_erl > -rw-rw-r--. 1 user user 214632 Jun 30 16:39 epmd > -rwxr-xr-x. 1 user user 248 Jun 30 16:39 erl > -rw-rw-r--. 1 user user 124088 Jun 30 16:39 erlc > -rw-rw-r--. 1 user user 60864 Jun 30 16:39 erl_child_setup > -rw-rw-r--. 1 user user 203776 Jun 30 16:39 erlexec > -rw-rw-r--. 1 user user 851 Jun 30 16:39 erl.src > -rw-rw-r--. 1 user user 127648 Jun 30 16:39 escript > -rw-rw-r--. 1 user user 31824 Jun 30 16:39 heart > -rw-rw-r--. 1 user user 181304 Jun 30 16:39 inet_gethost > -rwxr-xr-x. 1 user user 14037 Jun 30 16:39 install_upgrade.escript> -rwxr-xr-x. 1 user user 6080 Jun 30 16:39 nodetool > -rw-rw-r--. 1 user user 78160 Jun 30 16:39 run_erl > -rw-rw-r--. 1 user user 1154 Jun 30 16:39 start > -rw-rw-r--. 1 user user 1244 Jun 30 16:39 start_erl.src > -rw-rw-r--. 1 user user 1148 Jun 30 16:39 start.src > -rw-rw-r--. 1 user user 37216 Jun 30 16:39 to_erl > -rw-rw-r--. 1 user user 118232 Jun 30 16:39 typer > > Only three of the copied files have x attribute. > -wes > > On Sat, Jun 30, 2018 at 4:31 PM, Tristan Sloughter > wrote:>> __ >> relx and rebar3 are separate tools, but rebar3 includes relx for >> building releases. rebar3 builds applications, runs tests and handles >> dependencies, relx only does release creation.>> >> So if you download rebar3 you are getting relx but not the other way >> around, so if you are using erlang.mk you are only using relx.>> >> >> Tristan >> >> >> On Sat, Jun 30, 2018, at 4:27 PM, Wes James wrote: >>> I thought relx was just another name for rebar. I'm using erlang.mk >>> and it has relx in the script.>>> >>> I'm seeing these 2: >>> >>> https://github.com/erlang/rebar3 >>> >>> https://github.com/erlware/relx >>> >>> On Sat, Jun 30, 2018 at 4:20 PM, Wes James >>> wrote:>>>> I have 3.26.0. >>>> >>>> On Sat, Jun 30, 2018 at 4:16 PM, Wes James >>>> wrote:>>>>> OK. I thought I got the latest yesterday. I'll check again. >>>>> >>>>> On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter >>>>> wrote:>>>>>> __ >>>>>> This is with rebar3 3.6.1? Why is it under `_rel`? Did you set a >>>>>> different output directory or are you using relx directly? In >>>>>> which case make sure you have version 3.26.0.>>>>>> >>>>>> Tristan >>>>>> >>>>>> On Sat, Jun 30, 2018, at 4:05 PM, Wes James wrote: >>>>>>> I upgraded to erlang 21.0.1 and upgraded rebar3 to the latest >>>>>>> and built my project, but when I ran it I got an erlexec >>>>>>> permissions denied error. I noticed that most of the files in >>>>>>> _rel/project_name/erts-10.0.1/bin were set only rw not rwx. Is >>>>>>> this a bug or do I need to change a setting somewhere?>>>>>>> >>>>>>> This is when I run: _rel/bin/project_name console >>>>>>> >>>>>>> Thanks, >>>>>>> >>>>>>> -wes >>>>>>> _________________________________________________ >>>>>>> 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 awsafrahman1704@REDACTED Sun Jul 1 15:14:38 2018 From: awsafrahman1704@REDACTED (Awsaf Rahman) Date: Sun, 1 Jul 2018 15:14:38 +0200 Subject: [erlang-questions] Using File containing list as an input Message-ID: Hello! I am new to Erlang and need some help! I generated a random list of 100,000 numbers and wrote them in a file. Now I want to use that list in the file as an input for different programs. What I am trying to do is benchmark some programs written in Erlang like Merge Sort and I want to use the same list in different variations of the program. If anyone can help me out it would be of big help! Thanks! Regards Awsaf Rahman -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Sun Jul 1 16:03:14 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Sun, 1 Jul 2018 16:03:14 +0200 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> Message-ID: <5438a389-827a-3e7c-2a4a-8056de63fa0d@ninenines.eu> Just update erlang.mk and remove the cache and it'll work: $ make erlang-mk $ make distclean # or just rm -rf .erlang.mk to go faster $ make On 07/01/2018 12:27 AM, Wes James wrote: > I thought relx was just another name for rebar.? I'm using erlang.mk > and it has relx in the script. > > I'm seeing these 2: > > https://github.com/erlang/rebar3 > > https://github.com/erlware/relx > > On Sat, Jun 30, 2018 at 4:20 PM, Wes James > wrote: > > I have 3.26.0. > > On Sat, Jun 30, 2018 at 4:16 PM, Wes James > wrote: > > OK.? I thought I got the latest yesterday.? I'll check again. > > On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter > > wrote: > > __ > This is with rebar3 3.6.1? Why is it under `_rel`? Did you > set a different output directory or are you using relx > directly? In which case make sure you have version 3.26.0. > > Tristan > > On Sat, Jun 30, 2018, at 4:05 PM, Wes James wrote: >> I upgraded to erlang 21.0.1 and upgraded rebar3 to the >> latest and built my project, but when I ran it I got an >> erlexec permissions denied error.? I noticed that most of >> the files in _rel/project_name/erts-10.0.1/bin were set >> only rw not rwx.? Is this a bug or do I need to change a >> setting somewhere? >> >> This is when I run:? _rel/bin/project_name console >> >> Thanks, >> >> -wes >> _________________________________________________ >> 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 > -- Lo?c Hoguin https://ninenines.eu From kuna.prime@REDACTED Sun Jul 1 16:48:42 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Sun, 1 Jul 2018 16:48:42 +0200 Subject: [erlang-questions] Using File containing list as an input In-Reply-To: References: Message-ID: i think file:consult/1 (http://erlang.org/doc/man/file.html#consult-1) could be good for your usecase. On Sun, Jul 1, 2018 at 3:58 PM Awsaf Rahman wrote: > Hello! I am new to Erlang and need some help! > > I generated a random list of 100,000 numbers and wrote them in a file. Now > I want to use that list in the file as an input for different programs. > What I am trying to do is benchmark some programs written in Erlang like > Merge Sort and I want to use the same list in different variations of the > program. If anyone can help me out it would be of big help! > > Thanks! > > Regards > > Awsaf Rahman > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Sun Jul 1 18:22:04 2018 From: erlang@REDACTED (Joe Armstrong) Date: Sun, 1 Jul 2018 18:22:04 +0200 Subject: [erlang-questions] Using File containing list as an input In-Reply-To: References: Message-ID: I'll do this with a 4 element list to show the principle (you have a 100K list but it works the same way) 1> L = [1234,45,67,89]. [1234,45,67,89] 2> file:write_file("foo", term_to_binary(L)). ok 3> {ok, B} = file:read_file("foo"). {ok,<<131,108,0,0,0,4,98,0,0,4,210,97,45,97,67,97,89,106>>} 4> binary_to_term(B). [1234,45,67,89] term_to_binary turns anything into a binary which you save in a file binary_to_term is the inverse Cheers /Joe On Sun, Jul 1, 2018 at 3:14 PM, Awsaf Rahman wrote: > Hello! I am new to Erlang and need some help! > > I generated a random list of 100,000 numbers and wrote them in a file. Now I > want to use that list in the file as an input for different programs. What I > am trying to do is benchmark some programs written in Erlang like Merge Sort > and I want to use the same list in different variations of the program. If > anyone can help me out it would be of big help! > > Thanks! > > Regards > > Awsaf Rahman > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From bob@REDACTED Mon Jul 2 09:52:53 2018 From: bob@REDACTED (Bob Cowdery) Date: Mon, 2 Jul 2018 08:52:53 +0100 Subject: [erlang-questions] Error handling Message-ID: <8ef3c408-9ebf-a446-f9d8-23e6ce660d77@bobcowdery.plus.com> I have a node on a RaspberryPi and am spawning a process on there from another PC. The Pi process is failing to start because the appropriate hardware is not connected so its throwing an exception. However, the only information that the spawning process gets is **Can not start ... on ... **. The Pi node does not report the error. It makes no difference if I use spawn or spawn_link. How do I get the exception information back to my spawning process. Bob From aseigo@REDACTED Mon Jul 2 16:07:20 2018 From: aseigo@REDACTED (Aaron Seigo) Date: Mon, 02 Jul 2018 16:07:20 +0200 Subject: [erlang-questions] term_to_binary and large data structures In-Reply-To: References: Message-ID: <2333cb399091eea95ae19d5349e75e50@mykolab.com> On 2018-06-28 12:53, Jesper Louis Andersen wrote: > On Wed, Jun 27, 2018 at 11:24 PM Aaron Seigo > wrote: > >> In fact, for nearly any term you throw at it, this pretty simple >> algorithm produces smaller serialized data. You can see the format >> employed here: >> >> https://github.com/aseigo/packer/blob/develop/FORMAT.md > > ?That is also a format with different properties. The external term > format doubles as > an on-disk format where you might have the need to be robust against a > few bad blocks. There are ways to achieve that with schema-based formats, as well, of course... but, yes, as it currently stands the format above is not great for a disk format, though I would argue that external term format (ETF?) :) is also rather lacking for use on-disk unless one adds to the base format. > Schema-based formats tend to be worse than bloaty-prefix-encoded > formats here. It > probably hurts Elixir more since the map() type is the underlying > standard type for > many things whereas a record in Erlang is a tuple with some compile > time expansion on > top. In short, keys are not repeated in this format. Yes, records have some benefits indeed. However, the problem is not just maps. In fact, tuples are a big problem themselves. The ETF uses one byte for the type code (104 for a tuple with 0-255; 108 for larger tuples) and either a 1-byte or 4-byte integer containing the arity. That is 1 byte more than necessary for small tuples, and 4 extra bytes for larger tuples .. which is made more odd by the fact that tuples can only have 2^24 elements maximum; reading whole words is theoretically faster, so perhaps that was the motivation to tack on an extra byte ... Still, in a common case it takes 2 bytes to encode an empty (!) tuple, and 2 bytes to encode a small (the common case ime..) tuple. So a tuple like {1,2} requires 6 bytes to encode, {1,2,3} takes 8 ... with the compressed metadata approach this becomes 6 bytes for either of those tuples. Stuff a list with a bunch of tuples and the overhead adds up amazingly quickly: [{1, 2}, {3, 4}, {5, 6}] takes 25 bytes in the ETF, and 18 with the packer library. add one more similar tuple and we end up with 31 (!) bytes for ETF, and 20 with packer. There are a wide range of inefficiencies in the ETF, so hopefully we don't get sidetracked by maps alone. (In our use case, it was tuples killing us, not maps!) > You might want to look into Joe Armstrong's UBF stack in which you > define the schema > as a small stack engine and then interpret that engine to produce data. > It serves as a > hybrid in which you have a schema, but since the stack engine supports > a duplicate- > instruction, you can repeat keys in maps if they are the same and so > on. In turn, you Repeating data is easily, and usually more efficiently, compressed using a traditional compression tool. Packer uses zstd and it does a lovely job of this. It is really the metadata encoding ... > If you want to have a header-schema, it is probably worth it to just > take Protobuf3 > and see how well that format handles the data. There are 2 major problems with using this sort of solution: * none (that we are aware of) supports Erlang's range of data types; tuples in particular. So you are back to being "on your own". I would love to have had an OTS solution :) * we can not (for reasons of practicality) always know the type of data we will want to encode for a message, and so it is not possible to create the sort of schema definitions that these systems want (and which is an important source of their efficiency and safety). So while they 100% make sense in the right use cases, they are not a good fit for a general purpose erlang term serializer. > It has an encoding scheme, varints and ZigZag encoding which represents > integers in a > way which makes small integers small in the data > stream, and also compresses well. So > for real-world data, this encoding tend to win. Packer does the small integers thing as well :) > ?Ephemeral data transfer between nodes could benefit from having a new > format, or an > update which packs maps better. ... and tuples ;) Given that Packer does an equivalent or better job in terms of resulting number of bytes used in nearly every single term (and most of the remaining exceptions are addressable with simple additions, such as having a type code for empty list, list of small number, ala ETF), it is clear it is not just maps. > emulator/beam/external.c:BIF_RETTYPE term_to_binary_1(BIF_ALIST_1) cool; will look .. but the reason I wrote to the list first was in hopes to find out if there was appetite for such an improvement. IOW: are the odds of a quality implementation being upstreamed high enough to warrant our effort there :) > * You must write your code so it can be preempted (see the trap > variants) Yep ... > * The distribution protocol is a bit different and has an atom-cache > for common atoms. Yes, this is one place the distribution protocol has a leg up on packer due to access to the atom cache. > I'm not entirely sure this is the entry-point for it Even if not, messages for distribution should utilize that cache? > ?* We need backwards compatibility. In many cases even small changes to > this format has > proven to be riddled with loss of compatibility. My hopes go as follows: Use versioning in the distribution header to indicate that a newer serialization format is used; fall back to the existing format when that is not indicated. As there would be no change in data types expressable, this should only alter the representation of the data on the wire. > * We might want to rethink ordering properties of the produced binary. > I know this has > been a want historically, but I'm not sure we should grant that wish :P Do you have pointers to discussions on this so I can understand what you mean by "ordering properties" better? (Bug report, mailing list thread, etc.?) > * For distribution: More plugability would be really cool to have. Agreed :) > Finally, as for the goal of distributing computation: distribute data > is still my > advice. If data is distributed, computation distributes trivially. Unfortunately for us, our compute is expensive relative to the cost of the data. A small amount of data ends up creating a large amount of computation, which produces other not-very-big sets of data (I don't consider 100k pairs to be particularly large, esp when that can be serialized to <2MB, just as I don't think anyone seriously considers a 1GB SQL database to be large; but maybe that's just my perspective :) which in turns kicks off even more computation ... ... . the cost of computation is such that we need many machines working together on shared problems. Our problem occupies a space somewhere between more typical Erlang use cases (messaging, e.g.) and scientific computing, as it is neither but has some similar properties to both. As a result, for us it isn't enough to keep data local and move computation to the data. > Better distribution formats just shaves a constant factor Indeed; however currently that is a MASSIVE constant. With the data we have, it means the difference between 2.5mps (messages/second) on a 10Gbe networking verses 833mps. So the gap between the current ceiling and the new ceiling would be massive. Long term, you are absolutely correct, though, when you say: > so you eventually hit the same bottleneck in the long run. The Pre-compute sharding of the data space is an approach we use to avoid, or at least significantly delay beyond our requirements, the onset of that bottleneck ... > problem is that any kind of shared/copied data requires locking or > coordination. > Anything involving those parallelizes badly. -- This is not a property of the data in this application, other than the job queues, and that's only because we have those distributed for the purposes of durability. They also represent ~0% of the run time in the system, so the overhead there is ok. Thanks for the insights there, though, as they are .. well .. insightful ;) and bang-on for most applications. Cheers, -- Aaron From comptekki@REDACTED Mon Jul 2 16:32:03 2018 From: comptekki@REDACTED (Wes James) Date: Mon, 2 Jul 2018 08:32:03 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: <5438a389-827a-3e7c-2a4a-8056de63fa0d@ninenines.eu> References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> <5438a389-827a-3e7c-2a4a-8056de63fa0d@ninenines.eu> Message-ID: I tried that and erlexec, etc., are still rw instead of rwx on centos 7. I'll file a bug on the erlware/relx github repo. Thanks, -wes On Sun, Jul 1, 2018 at 8:03 AM, Lo?c Hoguin wrote: > Just update erlang.mk and remove the cache and it'll work: > > $ make erlang-mk > $ make distclean # or just rm -rf .erlang.mk to go faster > $ make > > On 07/01/2018 12:27 AM, Wes James wrote: > >> I thought relx was just another name for rebar. I'm using erlang.mk < >> http://erlang.mk> and it has relx in the script. >> >> I'm seeing these 2: >> >> https://github.com/erlang/rebar3 >> >> https://github.com/erlware/relx >> >> On Sat, Jun 30, 2018 at 4:20 PM, Wes James > comptekki@REDACTED>> wrote: >> >> I have 3.26.0. >> >> On Sat, Jun 30, 2018 at 4:16 PM, Wes James > > wrote: >> >> OK. I thought I got the latest yesterday. I'll check again. >> >> On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter >> > wrote: >> >> __ >> This is with rebar3 3.6.1? Why is it under `_rel`? Did you >> set a different output directory or are you using relx >> directly? In which case make sure you have version 3.26.0. >> >> Tristan >> >> On Sat, Jun 30, 2018, at 4:05 PM, Wes James wrote: >> >>> I upgraded to erlang 21.0.1 and upgraded rebar3 to the >>> latest and built my project, but when I ran it I got an >>> erlexec permissions denied error. I noticed that most of >>> the files in _rel/project_name/erts-10.0.1/bin were set >>> only rw not rwx. Is this a bug or do I need to change a >>> setting somewhere? >>> >>> This is when I run: _rel/bin/project_name console >>> >>> Thanks, >>> >>> -wes >>> _________________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED > g.org> >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- > Lo?c Hoguin > https://ninenines.eu > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Mon Jul 2 16:36:47 2018 From: erlang@REDACTED (Stefan Marr) Date: Mon, 2 Jul 2018 15:36:47 +0100 Subject: [erlang-questions] =?utf-8?q?CfP=3A_3rd_Workshop_on_Meta-Programm?= =?utf-8?q?ing_Techniques_and_Reflection_=28Meta=E2=80=9918=29=2C_Co-locat?= =?utf-8?q?ed_with_SPLASH_2018?= Message-ID: <95966E8E-EB40-46C9-AC92-A3C5A97CA26E@stefan-marr.de> ======================================================================== Call for Papers 3rd Workshop on Meta-Programming Techniques and Reflection (Meta?18) Co-located with SPLASH 2018 November 6, 2018, Boston, USA https://2018.splashcon.org/track/meta-2018 Follow us on twitter @MetaAtSPLASH ======================================================================== The Meta?18 workshop aims to bring together researchers working on metaprogramming and reflection, as well as users building applications, language extensions, or software tools using them. The changing hardware and software landscape, and the increased heterogeneity of systems make metaprogramming once more an important research topic to handle the associate complexity. The challenges which metaprogramming faces are manifold. They start with typing of reflective programs, continue with performance and tooling, and reach into the empirical field to understand how metaprogramming is used and how it affects software maintainability. While industry accepted metaprogramming on a wide scale with Ruby, Scala, JavaScript and others, academia still needs to bring it to the same level of convenience, tooling, and understanding as for direct programming styles. Contributions to the workshop are welcome on a wide range of topics related to the design, implementation, and application of metaprogramming techniques, as well as empirical studies on typing models for such systems and languages. ### Topics of Interest The workshop is a venue for all approaches that embrace metaprogramming, from static to dynamic techniques: - reflection, meta-level architectures, staging, open language runtimes applications to middleware, frameworks, and DSLs - optimization techniques - contract systems, or typing of reflective programs - reflection and metaobject protocols to enable tooling - case studies and evaluation of such techniques, e.g., to build applications, language extensions, or tools - empirical evaluation of metaprogramming solutions - security in reflective systems and capability-based designs - meta-level architectures and reflective middleware for modern runtime platforms (e.g. IoT, cyber-physical systems, mobile/cloud/grid computing, etc) - surveys, conceptualization, and taxonomization of existing approaches In short, we invite contributions to the workshop on a wide range of topics related to design, implementation, and application of reflective APIs and meta-programming techniques, as well as empirical studies and typing for such systems and languages. ### Workshop Format and Submissions This workshop welcomes the presentation of new ideas and emerging problems as well as mature work as part of a mini-conference format. Furthermore, we plan interactive brainstorming and demonstration sessions between the formal presentations to enable an active exchange of ideas. Papers submitted by the first deadline will be considered for publication in the ACM DL, if not requested otherwise by the authors. Thus, they will be part of SPLASH workshop proceedings. For all papers, use of the SIGPLAN acmart style is mandatory: http://www.sigplan.org/Resources/Author/. Please use the provided double-column templates for Latex or Word. technical paper: max. 8 pages, excluding references position and work-in-progress paper: 1-4 pages, excluding references technology demos or a posters: 1-page abstract Demos, posters, position and work-in-progress papers can be submitted on a second, later deadline to discuss the latest results and current work, but will not be considered for publication in the ACM DL. For the submission, please use the submission system at: https://meta18.hotcrp.com/ ### Important Dates 7 Aug 2018 - Abstract Submission 17 Aug 2018 - Paper Submission (considered for ACM DL) 14 Sep 2018 - Notification 7 Sep 2018 - Demo, position or work-in-progress paper submission 30 Sep 2018 - Demo, position or work-in-progress paper notification 6 Nov 2018 - Workshop ### Organizing Committee Guido Chari, Czech Technical University Elisa Gonzalez Boix, Vrije Universiteit Brussel Stefan Marr, University of Kent ### Program Committee Anya Helene Bagge, University of Bergen, Norway Camilo Bruni, Google, Germany Walter Cazzola, Universit? degli Studi di Milano, Italy Pascal Costanza, imec Marcus Denker, INRIA, Lille Matthew Flatt, University of Utah, United States Diego Garbervetsky, University of Buenos Aires, Argentina Eduardo Guerra, INPE, National Institute for Space Research Pablo Inostroza, CWI, Netherlands Hidehiko Masuhara, Tokyo Institute of Technology ,Japan Tom Van Cutsem, Nokia Bell Labs, Belgium -- Stefan Marr School of Computing, University of Kent http://stefan-marr.de/research/ From comptekki@REDACTED Mon Jul 2 17:01:31 2018 From: comptekki@REDACTED (Wes James) Date: Mon, 2 Jul 2018 09:01:31 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> <5438a389-827a-3e7c-2a4a-8056de63fa0d@ninenines.eu> Message-ID: It looks like this issue has already been posted on github (erlware/relx), issue #660. On Mon, Jul 2, 2018 at 8:32 AM, Wes James wrote: > I tried that and erlexec, etc., are still rw instead of rwx on centos 7. > I'll file a bug on the erlware/relx github repo. > > Thanks, > > -wes > > On Sun, Jul 1, 2018 at 8:03 AM, Lo?c Hoguin wrote: > >> Just update erlang.mk and remove the cache and it'll work: >> >> $ make erlang-mk >> $ make distclean # or just rm -rf .erlang.mk to go faster >> $ make >> >> On 07/01/2018 12:27 AM, Wes James wrote: >> >>> I thought relx was just another name for rebar. I'm using erlang.mk < >>> http://erlang.mk> and it has relx in the script. >>> >>> I'm seeing these 2: >>> >>> https://github.com/erlang/rebar3 >>> >>> https://github.com/erlware/relx >>> >>> On Sat, Jun 30, 2018 at 4:20 PM, Wes James >> comptekki@REDACTED>> wrote: >>> >>> I have 3.26.0. >>> >>> On Sat, Jun 30, 2018 at 4:16 PM, Wes James >> > wrote: >>> >>> OK. I thought I got the latest yesterday. I'll check again. >>> >>> On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter >>> > wrote: >>> >>> __ >>> This is with rebar3 3.6.1? Why is it under `_rel`? Did you >>> set a different output directory or are you using relx >>> directly? In which case make sure you have version 3.26.0. >>> >>> Tristan >>> >>> On Sat, Jun 30, 2018, at 4:05 PM, Wes James wrote: >>> >>>> I upgraded to erlang 21.0.1 and upgraded rebar3 to the >>>> latest and built my project, but when I ran it I got an >>>> erlexec permissions denied error. I noticed that most of >>>> the files in _rel/project_name/erts-10.0.1/bin were set >>>> only rw not rwx. Is this a bug or do I need to change a >>>> setting somewhere? >>>> >>>> This is when I run: _rel/bin/project_name console >>>> >>>> Thanks, >>>> >>>> -wes >>>> _________________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >> g.org> >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> -- >> Lo?c Hoguin >> https://ninenines.eu >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Mon Jul 2 17:04:25 2018 From: comptekki@REDACTED (Wes James) Date: Mon, 2 Jul 2018 09:04:25 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> <5438a389-827a-3e7c-2a4a-8056de63fa0d@ninenines.eu> Message-ID: Looking further down that issue discussion, it looks like it supposed to be fixed. I still have the wrong permissions on the copied erts/bin folder. On Mon, Jul 2, 2018 at 9:01 AM, Wes James wrote: > It looks like this issue has already been posted on github (erlware/relx), > issue #660. > > On Mon, Jul 2, 2018 at 8:32 AM, Wes James wrote: > >> I tried that and erlexec, etc., are still rw instead of rwx on centos 7. >> I'll file a bug on the erlware/relx github repo. >> >> Thanks, >> >> -wes >> >> On Sun, Jul 1, 2018 at 8:03 AM, Lo?c Hoguin wrote: >> >>> Just update erlang.mk and remove the cache and it'll work: >>> >>> $ make erlang-mk >>> $ make distclean # or just rm -rf .erlang.mk to go faster >>> $ make >>> >>> On 07/01/2018 12:27 AM, Wes James wrote: >>> >>>> I thought relx was just another name for rebar. I'm using erlang.mk < >>>> http://erlang.mk> and it has relx in the script. >>>> >>>> I'm seeing these 2: >>>> >>>> https://github.com/erlang/rebar3 >>>> >>>> https://github.com/erlware/relx >>>> >>>> On Sat, Jun 30, 2018 at 4:20 PM, Wes James >>> > wrote: >>>> >>>> I have 3.26.0. >>>> >>>> On Sat, Jun 30, 2018 at 4:16 PM, Wes James >>> > wrote: >>>> >>>> OK. I thought I got the latest yesterday. I'll check again. >>>> >>>> On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter >>>> > wrote: >>>> >>>> __ >>>> This is with rebar3 3.6.1? Why is it under `_rel`? Did you >>>> set a different output directory or are you using relx >>>> directly? In which case make sure you have version 3.26.0. >>>> >>>> Tristan >>>> >>>> On Sat, Jun 30, 2018, at 4:05 PM, Wes James wrote: >>>> >>>>> I upgraded to erlang 21.0.1 and upgraded rebar3 to the >>>>> latest and built my project, but when I ran it I got an >>>>> erlexec permissions denied error. I noticed that most of >>>>> the files in _rel/project_name/erts-10.0.1/bin were set >>>>> only rw not rwx. Is this a bug or do I need to change a >>>>> setting somewhere? >>>>> >>>>> This is when I run: _rel/bin/project_name console >>>>> >>>>> Thanks, >>>>> >>>>> -wes >>>>> _________________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>>> >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>> g.org> >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> -- >>> Lo?c Hoguin >>> https://ninenines.eu >>> >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Mon Jul 2 17:06:34 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 2 Jul 2018 17:06:34 +0200 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> <5438a389-827a-3e7c-2a4a-8056de63fa0d@ninenines.eu> Message-ID: <00fa7024-38e6-715c-6498-e527bbd1b612@ninenines.eu> Yes but that issue is supposed to be resolved for both current versions of rebar3 and erlang.mk. Try: $ ./.erlang.mk/relx --version 3.26.0 If you don't have this version, then your Relx is probably outdated, maybe you have a specific version configured via RELX_URL or are building it yourself in another way? If you do have this version then you probably have a genuine bug. Cheers, On 07/02/2018 05:01 PM, Wes James wrote: > It looks like this issue has already been posted on github > (erlware/relx), issue #660. > > On Mon, Jul 2, 2018 at 8:32 AM, Wes James > wrote: > > I tried that and erlexec, etc., are still rw instead of rwx on > centos 7.? I'll file a bug on the erlware/relx github repo. > > Thanks, > > -wes > > On Sun, Jul 1, 2018 at 8:03 AM, Lo?c Hoguin > wrote: > > Just update erlang.mk and remove the cache > and it'll work: > > $ make erlang-mk > $ make distclean? ? # or just rm -rf .erlang.mk > to go faster > $ make > > On 07/01/2018 12:27 AM, Wes James wrote: > > I thought relx was just another name for rebar.? I'm using > erlang.mk and it has > relx in the script. > > I'm seeing these 2: > > https://github.com/erlang/rebar3 > > > https://github.com/erlware/relx > > > On Sat, Jun 30, 2018 at 4:20 PM, Wes James > > >> > wrote: > > ? ? I have 3.26.0. > > ? ? On Sat, Jun 30, 2018 at 4:16 PM, Wes James > > ? ? >> wrote: > > ? ? ? ? OK.? I thought I got the latest yesterday.? I'll > check again. > > ? ? ? ? On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter > ? ? ? ? > >> wrote: > > ? ? ? ? ? ? __ > ? ? ? ? ? ? This is with rebar3 3.6.1? Why is it under > `_rel`? Did you > ? ? ? ? ? ? set a different output directory or are you > using relx > ? ? ? ? ? ? directly? In which case make sure you have > version 3.26.0. > > ? ? ? ? ? ? Tristan > > ? ? ? ? ? ? On Sat, Jun 30, 2018, at 4:05 PM, Wes James wrote: > > ? ? ? ? ? ? I upgraded to erlang 21.0.1 and upgraded > rebar3 to the > ? ? ? ? ? ? latest and built my project, but when I ran > it I got an > ? ? ? ? ? ? erlexec permissions denied error.? I > noticed that most of > ? ? ? ? ? ? the files in > _rel/project_name/erts-10.0.1/bin were set > ? ? ? ? ? ? only rw not rwx.? Is this a bug or do I > need to change a > ? ? ? ? ? ? setting somewhere? > > ? ? ? ? ? ? This is when I run:? _rel/bin/project_name > console > > ? ? ? ? ? ? Thanks, > > ? ? ? ? ? ? -wes > > _________________________________________________ > ? ? ? ? ? ? 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 > > > > -- > Lo?c Hoguin > https://ninenines.eu > > > -- Lo?c Hoguin https://ninenines.eu From comptekki@REDACTED Mon Jul 2 17:37:43 2018 From: comptekki@REDACTED (Wes James) Date: Mon, 2 Jul 2018 09:37:43 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: <00fa7024-38e6-715c-6498-e527bbd1b612@ninenines.eu> References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> <5438a389-827a-3e7c-2a4a-8056de63fa0d@ninenines.eu> <00fa7024-38e6-715c-6498-e527bbd1b612@ninenines.eu> Message-ID: .erlang.mk/relx says 2.23.0. Looking in erlang.mk, it looked like it was pulling from erlware/relx master. How do I get it to pull 2.26.0? On Mon, Jul 2, 2018 at 9:06 AM, Lo?c Hoguin wrote: > Yes but that issue is supposed to be resolved for both current versions of > rebar3 and erlang.mk. > > Try: > > $ ./.erlang.mk/relx --version > 3.26.0 > > If you don't have this version, then your Relx is probably outdated, maybe > you have a specific version configured via RELX_URL or are building it > yourself in another way? > > If you do have this version then you probably have a genuine bug. > > Cheers, > > On 07/02/2018 05:01 PM, Wes James wrote: > >> It looks like this issue has already been posted on github >> (erlware/relx), issue #660. >> >> On Mon, Jul 2, 2018 at 8:32 AM, Wes James > comptekki@REDACTED>> wrote: >> >> I tried that and erlexec, etc., are still rw instead of rwx on >> centos 7. I'll file a bug on the erlware/relx github repo. >> >> Thanks, >> >> -wes >> >> On Sun, Jul 1, 2018 at 8:03 AM, Lo?c Hoguin > > wrote: >> >> Just update erlang.mk and remove the cache >> and it'll work: >> >> $ make erlang-mk >> $ make distclean # or just rm -rf .erlang.mk >> to go faster >> $ make >> >> On 07/01/2018 12:27 AM, Wes James wrote: >> >> I thought relx was just another name for rebar. I'm using >> erlang.mk and it has >> relx in the script. >> >> I'm seeing these 2: >> >> https://github.com/erlang/rebar3 >> >> >> https://github.com/erlware/relx >> >> >> On Sat, Jun 30, 2018 at 4:20 PM, Wes James >> >> >> >> wrote: >> >> I have 3.26.0. >> >> On Sat, Jun 30, 2018 at 4:16 PM, Wes James >> >> > >> wrote: >> >> OK. I thought I got the latest yesterday. I'll >> check again. >> >> On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter >> >> >> wrote: >> >> __ >> This is with rebar3 3.6.1? Why is it under >> `_rel`? Did you >> set a different output directory or are you >> using relx >> directly? In which case make sure you have >> version 3.26.0. >> >> Tristan >> >> On Sat, Jun 30, 2018, at 4:05 PM, Wes James >> wrote: >> >> I upgraded to erlang 21.0.1 and upgraded >> rebar3 to the >> latest and built my project, but when I ran >> it I got an >> erlexec permissions denied error. I >> noticed that most of >> the files in >> _rel/project_name/erts-10.0.1/bin were set >> only rw not rwx. Is this a bug or do I >> need to change a >> setting somewhere? >> >> This is when I run: _rel/bin/project_name >> console >> >> Thanks, >> >> -wes >> ______________________________ >> ___________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> >> > > >> http://erlang.org/mailman/listinfo/erlang-questions >> >> < >> http://erlang.org/mailman/listinfo/erlang-questions >> > >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> >> > > >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > tinfo/erlang-questions >> > >> >> >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED > g.org> >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> -- Lo?c Hoguin >> https://ninenines.eu >> >> >> >> > -- > Lo?c Hoguin > https://ninenines.eu > -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Mon Jul 2 17:39:32 2018 From: comptekki@REDACTED (Wes James) Date: Mon, 2 Jul 2018 09:39:32 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> <5438a389-827a-3e7c-2a4a-8056de63fa0d@ninenines.eu> <00fa7024-38e6-715c-6498-e527bbd1b612@ninenines.eu> Message-ID: I have been using cowboy 2.4.0. I'm guessing cowboy master will pull the correct one. On Mon, Jul 2, 2018 at 9:37 AM, Wes James wrote: > .erlang.mk/relx says 2.23.0. Looking in erlang.mk, it looked like it was > pulling from erlware/relx master. How do I get it to pull 2.26.0? > > On Mon, Jul 2, 2018 at 9:06 AM, Lo?c Hoguin wrote: > >> Yes but that issue is supposed to be resolved for both current versions >> of rebar3 and erlang.mk. >> >> Try: >> >> $ ./.erlang.mk/relx --version >> 3.26.0 >> >> If you don't have this version, then your Relx is probably outdated, >> maybe you have a specific version configured via RELX_URL or are building >> it yourself in another way? >> >> If you do have this version then you probably have a genuine bug. >> >> Cheers, >> >> On 07/02/2018 05:01 PM, Wes James wrote: >> >>> It looks like this issue has already been posted on github >>> (erlware/relx), issue #660. >>> >>> On Mon, Jul 2, 2018 at 8:32 AM, Wes James >> comptekki@REDACTED>> wrote: >>> >>> I tried that and erlexec, etc., are still rw instead of rwx on >>> centos 7. I'll file a bug on the erlware/relx github repo. >>> >>> Thanks, >>> >>> -wes >>> >>> On Sun, Jul 1, 2018 at 8:03 AM, Lo?c Hoguin >> > wrote: >>> >>> Just update erlang.mk and remove the cache >>> and it'll work: >>> >>> $ make erlang-mk >>> $ make distclean # or just rm -rf .erlang.mk >>> to go faster >>> $ make >>> >>> On 07/01/2018 12:27 AM, Wes James wrote: >>> >>> I thought relx was just another name for rebar. I'm using >>> erlang.mk and it has >>> relx in the script. >>> >>> I'm seeing these 2: >>> >>> https://github.com/erlang/rebar3 >>> >>> >>> https://github.com/erlware/relx >>> >>> >>> On Sat, Jun 30, 2018 at 4:20 PM, Wes James >>> >>> >> >>> wrote: >>> >>> I have 3.26.0. >>> >>> On Sat, Jun 30, 2018 at 4:16 PM, Wes James >>> >>> >> >> wrote: >>> >>> OK. I thought I got the latest yesterday. I'll >>> check again. >>> >>> On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter >>> >>> >> wrote: >>> >>> __ >>> This is with rebar3 3.6.1? Why is it under >>> `_rel`? Did you >>> set a different output directory or are you >>> using relx >>> directly? In which case make sure you have >>> version 3.26.0. >>> >>> Tristan >>> >>> On Sat, Jun 30, 2018, at 4:05 PM, Wes James >>> wrote: >>> >>> I upgraded to erlang 21.0.1 and upgraded >>> rebar3 to the >>> latest and built my project, but when I ran >>> it I got an >>> erlexec permissions denied error. I >>> noticed that most of >>> the files in >>> _rel/project_name/erts-10.0.1/bin were set >>> only rw not rwx. Is this a bug or do I >>> need to change a >>> setting somewhere? >>> >>> This is when I run: _rel/bin/project_name >>> console >>> >>> Thanks, >>> >>> -wes >>> >>> _________________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> >>> >> > >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> < >>> http://erlang.org/mailman/listinfo/erlang-questions >>> > >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> >>> >> > >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> tinfo/erlang-questions >>> > >>> >>> >>> >>> >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >> g.org> >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >>> >>> -- Lo?c Hoguin >>> https://ninenines.eu >>> >>> >>> >>> >> -- >> Lo?c Hoguin >> https://ninenines.eu >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Mon Jul 2 17:43:51 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 2 Jul 2018 17:43:51 +0200 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> <5438a389-827a-3e7c-2a4a-8056de63fa0d@ninenines.eu> <00fa7024-38e6-715c-6498-e527bbd1b612@ninenines.eu> Message-ID: The steps I gave you earlier should have done it. Do it in the project where you build the release. Other erlang.mks don't matter. On 07/02/2018 05:39 PM, Wes James wrote: > I have been using cowboy 2.4.0.? I'm guessing cowboy master will pull > the correct one. > > On Mon, Jul 2, 2018 at 9:37 AM, Wes James > wrote: > > .erlang.mk/relx says 2.23.0.? Looking in > erlang.mk , it looked like it was pulling from > erlware/relx master.? How do I get it to pull 2.26.0? > > On Mon, Jul 2, 2018 at 9:06 AM, Lo?c Hoguin > wrote: > > Yes but that issue is supposed to be resolved for both current > versions of rebar3 and erlang.mk . > > Try: > > $ ./.erlang.mk/relx --version > 3.26.0 > > If you don't have this version, then your Relx is probably > outdated, maybe you have a specific version configured via > RELX_URL or are building it yourself in another way? > > If you do have this version then you probably have a genuine bug. > > Cheers, > > On 07/02/2018 05:01 PM, Wes James wrote: > > It looks like this issue has already been posted on github > (erlware/relx), issue #660. > > On Mon, Jul 2, 2018 at 8:32 AM, Wes James > > >> > wrote: > > ? ? I tried that and erlexec, etc., are still rw instead of > rwx on > ? ? centos 7.? I'll file a bug on the erlware/relx github repo. > > ? ? Thanks, > > ? ? -wes > > ? ? On Sun, Jul 1, 2018 at 8:03 AM, Lo?c Hoguin > > ? ? >> wrote: > > ? ? ? ? Just update erlang.mk > and remove the cache > ? ? ? ? and it'll work: > > ? ? ? ? $ make erlang-mk > ? ? ? ? $ make distclean? ? # or just rm -rf .erlang.mk > > ? ? ? ? to go faster > ? ? ? ? $ make > > ? ? ? ? On 07/01/2018 12:27 AM, Wes James wrote: > > ? ? ? ? ? ? I thought relx was just another name for > rebar.? I'm using > erlang.mk > and it has > ? ? ? ? ? ? relx in the script. > > ? ? ? ? ? ? I'm seeing these 2: > > https://github.com/erlang/rebar3 > > ? ? ? ? ? ? > > > https://github.com/erlware/relx > > ? ? ? ? ? ? > > > ? ? ? ? ? ? On Sat, Jun 30, 2018 at 4:20 PM, Wes James > ? ? ? ? ? ? > > ? ? ? ? ? ? >>> > ? ? ? ? ? ? wrote: > > ? ? ? ? ? ? ?? ? I have 3.26.0. > > ? ? ? ? ? ? ?? ? On Sat, Jun 30, 2018 at 4:16 PM, Wes James > ? ? ? ? ? ? > > ? ? ? ? ? ? ?? ? > ? ? ? ? ? ? >>> wrote: > > ? ? ? ? ? ? ?? ? ? ? OK.? I thought I got the latest > yesterday.? I'll > ? ? ? ? ? ? check again. > > ? ? ? ? ? ? ?? ? ? ? On Sat, Jun 30, 2018 at 4:14 PM, > Tristan Sloughter > ? ? ? ? ? ? ?? ? ? ? > > ? ? ? ? ? ? >>> wrote: > > ? ? ? ? ? ? ?? ? ? ? ? ? __ > ? ? ? ? ? ? ?? ? ? ? ? ? This is with rebar3 3.6.1? Why is > it under > ? ? ? ? ? ? `_rel`? Did you > ? ? ? ? ? ? ?? ? ? ? ? ? set a different output directory > or are you > ? ? ? ? ? ? using relx > ? ? ? ? ? ? ?? ? ? ? ? ? directly? In which case make sure > you have > ? ? ? ? ? ? version 3.26.0. > > ? ? ? ? ? ? ?? ? ? ? ? ? Tristan > > ? ? ? ? ? ? ?? ? ? ? ? ? On Sat, Jun 30, 2018, at 4:05 PM, > Wes James wrote: > > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? I upgraded to erlang 21.0.1 > and upgraded > ? ? ? ? ? ? ? ? rebar3 to the > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? latest and built my project, > but when I ran > ? ? ? ? ? ? ? ? it I got an > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? erlexec permissions denied > error.? I > ? ? ? ? ? ? ? ? noticed that most of > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? the files in > ? ? ? ? ? ? ? ? _rel/project_name/erts-10.0.1/bin were set > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? only rw not rwx.? Is this a > bug or do I > ? ? ? ? ? ? ? ? need to change a > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? setting somewhere? > > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? This is when I run: > _rel/bin/project_name > ? ? ? ? ? ? ? ? console > > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? Thanks, > > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? -wes > > _________________________________________________ > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? 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 > > > > > > > ? ? ? ? --? ? ? ? ?Lo?c Hoguin > https://ninenines.eu > > > > > -- > Lo?c Hoguin > https://ninenines.eu > > > -- Lo?c Hoguin https://ninenines.eu From comptekki@REDACTED Mon Jul 2 17:53:16 2018 From: comptekki@REDACTED (Wes James) Date: Mon, 2 Jul 2018 09:53:16 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: <00fa7024-38e6-715c-6498-e527bbd1b612@ninenines.eu> References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> <5438a389-827a-3e7c-2a4a-8056de63fa0d@ninenines.eu> <00fa7024-38e6-715c-6498-e527bbd1b612@ninenines.eu> Message-ID: I did: make erlang.mk make distclean make then .erlang.mk/relx --version says 3.24.5 On Mon, Jul 2, 2018 at 9:06 AM, Lo?c Hoguin wrote: > Yes but that issue is supposed to be resolved for both current versions of > rebar3 and erlang.mk. > > Try: > > $ ./.erlang.mk/relx --version > 3.26.0 > > If you don't have this version, then your Relx is probably outdated, maybe > you have a specific version configured via RELX_URL or are building it > yourself in another way? > > If you do have this version then you probably have a genuine bug. > > Cheers, > > On 07/02/2018 05:01 PM, Wes James wrote: > >> It looks like this issue has already been posted on github >> (erlware/relx), issue #660. >> >> On Mon, Jul 2, 2018 at 8:32 AM, Wes James > comptekki@REDACTED>> wrote: >> >> I tried that and erlexec, etc., are still rw instead of rwx on >> centos 7. I'll file a bug on the erlware/relx github repo. >> >> Thanks, >> >> -wes >> >> On Sun, Jul 1, 2018 at 8:03 AM, Lo?c Hoguin > > wrote: >> >> Just update erlang.mk and remove the cache >> and it'll work: >> >> $ make erlang-mk >> $ make distclean # or just rm -rf .erlang.mk >> to go faster >> $ make >> >> On 07/01/2018 12:27 AM, Wes James wrote: >> >> I thought relx was just another name for rebar. I'm using >> erlang.mk and it has >> relx in the script. >> >> I'm seeing these 2: >> >> https://github.com/erlang/rebar3 >> >> >> https://github.com/erlware/relx >> >> >> On Sat, Jun 30, 2018 at 4:20 PM, Wes James >> >> >> >> wrote: >> >> I have 3.26.0. >> >> On Sat, Jun 30, 2018 at 4:16 PM, Wes James >> >> > >> wrote: >> >> OK. I thought I got the latest yesterday. I'll >> check again. >> >> On Sat, Jun 30, 2018 at 4:14 PM, Tristan Sloughter >> >> >> wrote: >> >> __ >> This is with rebar3 3.6.1? Why is it under >> `_rel`? Did you >> set a different output directory or are you >> using relx >> directly? In which case make sure you have >> version 3.26.0. >> >> Tristan >> >> On Sat, Jun 30, 2018, at 4:05 PM, Wes James >> wrote: >> >> I upgraded to erlang 21.0.1 and upgraded >> rebar3 to the >> latest and built my project, but when I ran >> it I got an >> erlexec permissions denied error. I >> noticed that most of >> the files in >> _rel/project_name/erts-10.0.1/bin were set >> only rw not rwx. Is this a bug or do I >> need to change a >> setting somewhere? >> >> This is when I run: _rel/bin/project_name >> console >> >> Thanks, >> >> -wes >> ______________________________ >> ___________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> >> > > >> http://erlang.org/mailman/listinfo/erlang-questions >> >> < >> http://erlang.org/mailman/listinfo/erlang-questions >> > >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> >> > > >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > tinfo/erlang-questions >> > >> >> >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED > g.org> >> http://erlang.org/mailman/listinfo/erlang-questions >> >> >> >> -- Lo?c Hoguin >> https://ninenines.eu >> >> >> >> > -- > Lo?c Hoguin > https://ninenines.eu > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Mon Jul 2 17:54:45 2018 From: roger@REDACTED (Roger Lipscombe) Date: Mon, 2 Jul 2018 16:54:45 +0100 Subject: [erlang-questions] Node not responding to init:stop() Message-ID: This sounds similar to http://erlang.org/pipermail/erlang-questions/2012-December/071223.html, but it's not quite the same, as far as I can tell. I've noticed that, at some point since upgrading from OTP-20.3 to OTP-21.0 (along with the necessary dependency updates), my Erlang nodes are no longer stopping at the end of our system test run. The nodes are orchestrated by having 'erlexec' run a bash script which uses (effectively) 'foo/bin/foo foreground &'. I'm relying on erlexec killing the bash script and that killing the nodes. This works fine when the nodes are using OTP-20.3, but not with OTP-21.0. If I connect to the node, I can issue 'init:stop()', and it returns ok, but nothing happens. If I use 'application:which_applications()', I get a timeout. Unlike the linked discussion, I _can_ repeatedly connect a remote shell (using erl -remsh), but I have to resort to erlang:halt() to stop the node. Since my system test environment relies on orderly process group teardown to stop the nodes, that's not useful. As I understand it, process group teardown results in SIGTERM, which results in a call to init:stop, which should stop the node. It isn't. How do I figure out why init:stop() isn't working? From essen@REDACTED Mon Jul 2 17:55:53 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 2 Jul 2018 17:55:53 +0200 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> <5438a389-827a-3e7c-2a4a-8056de63fa0d@ninenines.eu> <00fa7024-38e6-715c-6498-e527bbd1b612@ninenines.eu> Message-ID: It's $ make erlang-mk With a dash, not a dot. It should produce some output to indicate that it's updating. Cheers, On 07/02/2018 05:53 PM, Wes James wrote: > I did: > > make erlang.mk > make distclean > make > > then .erlang.mk/relx --version says 3.24.5 > > On Mon, Jul 2, 2018 at 9:06 AM, Lo?c Hoguin > wrote: > > Yes but that issue is supposed to be resolved for both current > versions of rebar3 and erlang.mk . > > Try: > > $ ./.erlang.mk/relx --version > 3.26.0 > > If you don't have this version, then your Relx is probably outdated, > maybe you have a specific version configured via RELX_URL or are > building it yourself in another way? > > If you do have this version then you probably have a genuine bug. > > Cheers, > > On 07/02/2018 05:01 PM, Wes James wrote: > > It looks like this issue has already been posted on github > (erlware/relx), issue #660. > > On Mon, Jul 2, 2018 at 8:32 AM, Wes James >> wrote: > > ? ? I tried that and erlexec, etc., are still rw instead of rwx on > ? ? centos 7.? I'll file a bug on the erlware/relx github repo. > > ? ? Thanks, > > ? ? -wes > > ? ? On Sun, Jul 1, 2018 at 8:03 AM, Lo?c Hoguin > > ? ? >> wrote: > > ? ? ? ? Just update erlang.mk > and remove the cache > ? ? ? ? and it'll work: > > ? ? ? ? $ make erlang-mk > ? ? ? ? $ make distclean? ? # or just rm -rf .erlang.mk > > ? ? ? ? to go faster > ? ? ? ? $ make > > ? ? ? ? On 07/01/2018 12:27 AM, Wes James wrote: > > ? ? ? ? ? ? I thought relx was just another name for rebar. > I'm using > erlang.mk > and it has > ? ? ? ? ? ? relx in the script. > > ? ? ? ? ? ? I'm seeing these 2: > > https://github.com/erlang/rebar3 > ? ? ? ? ? ? > > > https://github.com/erlware/relx > ? ? ? ? ? ? > > > ? ? ? ? ? ? On Sat, Jun 30, 2018 at 4:20 PM, Wes James > ? ? ? ? ? ? > > > ? ? ? ? ? ? >>> > ? ? ? ? ? ? wrote: > > ? ? ? ? ? ? ?? ? I have 3.26.0. > > ? ? ? ? ? ? ?? ? On Sat, Jun 30, 2018 at 4:16 PM, Wes James > ? ? ? ? ? ? > > > ? ? ? ? ? ? ?? ? > ? ? ? ? ? ? >>> wrote: > > ? ? ? ? ? ? ?? ? ? ? OK.? I thought I got the latest > yesterday.? I'll > ? ? ? ? ? ? check again. > > ? ? ? ? ? ? ?? ? ? ? On Sat, Jun 30, 2018 at 4:14 PM, Tristan > Sloughter > ? ? ? ? ? ? ?? ? ? ? > > > ? ? ? ? ? ? > >>> wrote: > > ? ? ? ? ? ? ?? ? ? ? ? ? __ > ? ? ? ? ? ? ?? ? ? ? ? ? This is with rebar3 3.6.1? Why is it under > ? ? ? ? ? ? `_rel`? Did you > ? ? ? ? ? ? ?? ? ? ? ? ? set a different output directory or > are you > ? ? ? ? ? ? using relx > ? ? ? ? ? ? ?? ? ? ? ? ? directly? In which case make sure you have > ? ? ? ? ? ? version 3.26.0. > > ? ? ? ? ? ? ?? ? ? ? ? ? Tristan > > ? ? ? ? ? ? ?? ? ? ? ? ? On Sat, Jun 30, 2018, at 4:05 PM, Wes > James wrote: > > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? I upgraded to erlang 21.0.1 and > upgraded > ? ? ? ? ? ? ? ? rebar3 to the > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? latest and built my project, but > when I ran > ? ? ? ? ? ? ? ? it I got an > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? erlexec permissions denied error.? I > ? ? ? ? ? ? ? ? noticed that most of > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? the files in > ? ? ? ? ? ? ? ? _rel/project_name/erts-10.0.1/bin were set > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? only rw not rwx.? Is this a bug or > do I > ? ? ? ? ? ? ? ? need to change a > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? setting somewhere? > > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? This is when I run: > _rel/bin/project_name > ? ? ? ? ? ? ? ? console > > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? Thanks, > > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? -wes > > _________________________________________________ > ? ? ? ? ? ? ? ? ?? ? ? ? ? ? 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 > > > > > > > ? ? ? ? --? ? ? ? ?Lo?c Hoguin > https://ninenines.eu > > > > > -- > Lo?c Hoguin > https://ninenines.eu > > -- Lo?c Hoguin https://ninenines.eu From comptekki@REDACTED Mon Jul 2 18:02:46 2018 From: comptekki@REDACTED (Wes James) Date: Mon, 2 Jul 2018 10:02:46 -0600 Subject: [erlang-questions] erlexec permissions denied error on start after building release In-Reply-To: References: <1530396843.3141260.1425919864.606EDCCD@webmail.messagingengine.com> <5438a389-827a-3e7c-2a4a-8056de63fa0d@ninenines.eu> <00fa7024-38e6-715c-6498-e527bbd1b612@ninenines.eu> Message-ID: That did it! relx --version is now 3.26.0 and the permissions are correct now in the release folder. Thanks! -wes On Mon, Jul 2, 2018 at 9:55 AM, Lo?c Hoguin wrote: > It's > > $ make erlang-mk > > With a dash, not a dot. > > It should produce some output to indicate that it's updating. > > Cheers, > > On 07/02/2018 05:53 PM, Wes James wrote: > >> I did: >> >> make erlang.mk >> make distclean >> make >> >> then .erlang.mk/relx --version says 3.24.5 >> >> On Mon, Jul 2, 2018 at 9:06 AM, Lo?c Hoguin > essen@REDACTED>> wrote: >> >> Yes but that issue is supposed to be resolved for both current >> versions of rebar3 and erlang.mk . >> >> Try: >> >> $ ./.erlang.mk/relx --version >> 3.26.0 >> >> If you don't have this version, then your Relx is probably outdated, >> maybe you have a specific version configured via RELX_URL or are >> building it yourself in another way? >> >> If you do have this version then you probably have a genuine bug. >> >> Cheers, >> >> On 07/02/2018 05:01 PM, Wes James wrote: >> >> It looks like this issue has already been posted on github >> (erlware/relx), issue #660. >> >> On Mon, Jul 2, 2018 at 8:32 AM, Wes James > > >> wrote: >> >> I tried that and erlexec, etc., are still rw instead of rwx >> on >> centos 7. I'll file a bug on the erlware/relx github repo. >> >> Thanks, >> >> -wes >> >> On Sun, Jul 1, 2018 at 8:03 AM, Lo?c Hoguin >> >> >> >> wrote: >> >> Just update erlang.mk >> and remove the cache >> and it'll work: >> >> $ make erlang-mk >> $ make distclean # or just rm -rf .erlang.mk >> >> to go faster >> $ make >> >> On 07/01/2018 12:27 AM, Wes James wrote: >> >> I thought relx was just another name for rebar. >> I'm using >> erlang.mk >> and it has >> relx in the script. >> >> I'm seeing these 2: >> >> https://github.com/erlang/rebar3 > ar3> >> > > >> >> https://github.com/erlware/relx >> > > >> >> On Sat, Jun 30, 2018 at 4:20 PM, Wes James >> >> > >> > > >>> >> wrote: >> >> I have 3.26.0. >> >> On Sat, Jun 30, 2018 at 4:16 PM, Wes James >> >> > >> > >> > >>> wrote: >> >> OK. I thought I got the latest >> yesterday. I'll >> check again. >> >> On Sat, Jun 30, 2018 at 4:14 PM, Tristan >> Sloughter >> >> > >> >> >>> wrote: >> >> __ >> This is with rebar3 3.6.1? Why is it >> under >> `_rel`? Did you >> set a different output directory or >> are you >> using relx >> directly? In which case make sure you >> have >> version 3.26.0. >> >> Tristan >> >> On Sat, Jun 30, 2018, at 4:05 PM, Wes >> James wrote: >> >> I upgraded to erlang 21.0.1 and >> upgraded >> rebar3 to the >> latest and built my project, but >> when I ran >> it I got an >> erlexec permissions denied error. I >> noticed that most of >> the files in >> _rel/project_name/erts-10.0.1/bin were set >> only rw not rwx. Is this a bug or >> do I >> need to change a >> setting somewhere? >> >> This is when I run: >> _rel/bin/project_name >> console >> >> Thanks, >> >> -wes >> >> _________________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> > > >> > erlang-questions@REDACTED >> >> > >> >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > tinfo/erlang-questions >> > >> < >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > tinfo/erlang-questions >> >> >> >> >> >> _____________________________ >> __________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> > > >> > >> > >> >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > tinfo/erlang-questions >> > >> < >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > tinfo/erlang-questions >> >> >> >> >> >> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> > > >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > tinfo/erlang-questions >> > >> >> >> -- Lo?c Hoguin >> https://ninenines.eu >> >> >> >> >> -- Lo?c Hoguin >> https://ninenines.eu >> >> >> > -- > Lo?c Hoguin > https://ninenines.eu > -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Mon Jul 2 18:24:29 2018 From: roger@REDACTED (Roger Lipscombe) Date: Mon, 2 Jul 2018 17:24:29 +0100 Subject: [erlang-questions] Node not responding to init:stop() In-Reply-To: References: Message-ID: Right, so I've done some digging. I got a crash dump and by looking at the stack trace for application_controller, I can see that it's hanging in application_controller:terminate, presumably while waiting for one of the processes to stop. The pid given is <0.893.0>. Looking a bit further up the stack trace gets me the process state (possibly stale?), which contains a bunch of applications and pids. The pid it's hanging on is 'kernel', which I'd expect to be the last (?) application to be shut down. The process state (assuming it's not stale) has a load of other applications in there with pids. There are a bunch of ours, but also others, such as runtime_tools, cowboy, amqp_client, hackney, lager, etc. Is any of this useful in finding out why it's hanging? On 2 July 2018 at 16:54, Roger Lipscombe wrote: > This sounds similar to > http://erlang.org/pipermail/erlang-questions/2012-December/071223.html, > but it's not quite the same, as far as I can tell. > > I've noticed that, at some point since upgrading from OTP-20.3 to > OTP-21.0 (along with the necessary dependency updates), my Erlang > nodes are no longer stopping at the end of our system test run. > > The nodes are orchestrated by having 'erlexec' run a bash script which > uses (effectively) 'foo/bin/foo foreground &'. I'm relying on erlexec > killing the bash script and that killing the nodes. This works fine > when the nodes are using OTP-20.3, but not with OTP-21.0. > > If I connect to the node, I can issue 'init:stop()', and it returns > ok, but nothing happens. If I use 'application:which_applications()', > I get a timeout. > > Unlike the linked discussion, I _can_ repeatedly connect a remote > shell (using erl -remsh), but I have to resort to erlang:halt() to > stop the node. Since my system test environment relies on orderly > process group teardown to stop the nodes, that's not useful. > > As I understand it, process group teardown results in SIGTERM, which > results in a call to init:stop, which should stop the node. It isn't. > > How do I figure out why init:stop() isn't working? From awsafrahman1704@REDACTED Mon Jul 2 23:36:10 2018 From: awsafrahman1704@REDACTED (Awsaf Rahman) Date: Mon, 2 Jul 2018 23:36:10 +0200 Subject: [erlang-questions] Generating a list of lists containing random numbers Message-ID: Hello! I am trying to determine the execution time for my matrix multiplication program and for that I need to generate a large enough List of Lists of random integers. Say I want to generate a matrix with a 1000 rows (that is 1000 lists inside a list). Is there any way of doing it? I can generate a list of random numbers using list comprehension but can't figure out how to go about building a list of lists. Regards Awsaf -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Tue Jul 3 06:15:17 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Tue, 03 Jul 2018 13:15:17 +0900 Subject: [erlang-questions] Generating a list of lists containing random numbers In-Reply-To: References: Message-ID: <4957339.naqcQyKLIm@takoyaki> On 2018?7?2???? 23?36?10? JST Awsaf Rahman wrote: > Hello! > > I am trying to determine the execution time for my matrix multiplication > program and for that I need to generate a large enough List of Lists of > random integers. Say I want to generate a matrix with a 1000 rows (that is > 1000 lists inside a list). Is there any way of doing it? I can generate a > list of random numbers using list comprehension but can't figure out how to > go about building a list of lists. Wheels within wheels, man... -module(genset). -export([generate/1]). generate(Size) -> Generate = fun() -> rand:uniform(1000) end, MakeList = fun() -> populate(Generate, Size, []) end, populate(MakeList, Size, []). populate(_, Size, Acc) when Size < 0 -> Acc; populate(Generate, Size, Acc) -> populate(Generate, Size - 1, [Generate() | Acc]). -Craig From raimo+erlang-questions@REDACTED Tue Jul 3 08:33:12 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Tue, 3 Jul 2018 08:33:12 +0200 Subject: [erlang-questions] Generating a list of lists containing random numbers In-Reply-To: <4957339.naqcQyKLIm@takoyaki> References: <4957339.naqcQyKLIm@takoyaki> Message-ID: <20180703063312.GA98572@erix.ericsson.se> On Tue, Jul 03, 2018 at 01:15:17PM +0900, zxq9@REDACTED wrote: > On 2018?7?2???? 23?36?10? JST Awsaf Rahman wrote: > > Hello! > > > > I am trying to determine the execution time for my matrix multiplication > > program and for that I need to generate a large enough List of Lists of > > random integers. Say I want to generate a matrix with a 1000 rows (that is > > 1000 lists inside a list). Is there any way of doing it? I can generate a > > list of random numbers using list comprehension but can't figure out how to > > go about building a list of lists. > > Wheels within wheels, man... > > -module(genset). > -export([generate/1]). > > generate(Size) -> > Generate = fun() -> rand:uniform(1000) end, > MakeList = fun() -> populate(Generate, Size, []) end, > populate(MakeList, Size, []). > > > populate(_, Size, Acc) when Size < 0 -> > Acc; > populate(Generate, Size, Acc) -> > populate(Generate, Size - 1, [Generate() | Acc]). > > > -Craig This may be a missing function for the lists module: buildr(N, Fun, Acc) -> buildr(N, Fun, Acc, []). %% buildr(0, _Fun, Acc, R) -> {R, Acc}; buildr(N, Fun, Acc, R) -> {V, NewAcc} = Fun(Acc), buildr(N - 1, Fun, NewAcc, [V|R]). Example usage: Base = 0, Range = 1 bsl 32, {ListOfLists, _NewSeed} = buildr( 1000, fun (Seed) -> buildr( 1000, %%fun rand:uniform_s/1, fun (S) -> {V, NewS} = rand:uniform_s(Range, S), {Base + V - 1, NewS} end, Seed) end, rand:seed_s(exrop)), -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From zxq9@REDACTED Tue Jul 3 09:08:18 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Tue, 03 Jul 2018 16:08:18 +0900 Subject: [erlang-questions] Generating a list of lists containing random numbers In-Reply-To: <20180703063312.GA98572@erix.ericsson.se> References: <4957339.naqcQyKLIm@takoyaki> <20180703063312.GA98572@erix.ericsson.se> Message-ID: <4063921.JJgkbPxITg@takoyaki> On 2018?7?3???? 8?33?12? JST Raimo Niskanen wrote: > On Tue, Jul 03, 2018 at 01:15:17PM +0900, zxq9@REDACTED wrote: > > On 2018?7?2???? 23?36?10? JST Awsaf Rahman wrote: > > > Hello! > > > > > > I am trying to determine the execution time for my matrix multiplication > > > program and for that I need to generate a large enough List of Lists of > > > random integers. Say I want to generate a matrix with a 1000 rows (that is > > > 1000 lists inside a list). Is there any way of doing it? I can generate a > > > list of random numbers using list comprehension but can't figure out how to > > > go about building a list of lists. > > > > Wheels within wheels, man... > > > > -module(genset). > > -export([generate/1]). > > > > generate(Size) -> > > Generate = fun() -> rand:uniform(1000) end, > > MakeList = fun() -> populate(Generate, Size, []) end, > > populate(MakeList, Size, []). > > > > > > populate(_, Size, Acc) when Size < 0 -> > > Acc; > > populate(Generate, Size, Acc) -> > > populate(Generate, Size - 1, [Generate() | Acc]). > > > > > > -Craig > > This may be a missing function for the lists module: > > buildr(N, Fun, Acc) -> > buildr(N, Fun, Acc, []). > %% > buildr(0, _Fun, Acc, R) -> > {R, Acc}; > buildr(N, Fun, Acc, R) -> > {V, NewAcc} = Fun(Acc), > buildr(N - 1, Fun, NewAcc, [V|R]). > > Example usage: > > Base = 0, > Range = 1 bsl 32, > {ListOfLists, _NewSeed} = > buildr( > 1000, > fun (Seed) -> > buildr( > 1000, > %%fun rand:uniform_s/1, > fun (S) -> > {V, NewS} = rand:uniform_s(Range, S), > {Base + V - 1, NewS} > end, > Seed) > end, > rand:seed_s(exrop)), > > I think I'd rather have matrix operations in a matrix module. Every time I've needed to do matrix operations the need has either been: 1) Trivial, flat matrix operations over regular matrices of regular dimensions populated by scalar values & a well-defined _|_. OR 2) Matrices that are specialized enough that they really deserve a custom set of handlers all their own. In case 1 there are enough regular operations (especially against numeric values) that you could fill out a full-blown matrix_math module and still not cover everything. I wouldn't want that to clutter the lists module. In case 2 trying to generalize is futile because remembering the details of the abstractions involved is more trouble than writing a special handler, hence things like this: https://gitlab.com/zxq9/zxWidgets/blob/master/src/zxw.erl#L194 I wouldn't want to attempt to generalize a text grid metawidget generator because the assumptions embedded in it will break in any other situation, but nonetheless, it is a matrix operation to generate, populate, and extract or modify data in it. I've got a naive matrix math module around here somewhere that I wrote as an example for a guy on SO a while back... but it only handles a few math operations, flips, inversions and rotations. Would people be interested in a matrix_math library? -Craig From pierrefenoll@REDACTED Tue Jul 3 09:13:37 2018 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Tue, 3 Jul 2018 09:13:37 +0200 Subject: [erlang-questions] Generating a list of lists containing random numbers In-Reply-To: <20180703063312.GA98572@erix.ericsson.se> References: <4957339.naqcQyKLIm@takoyaki> <20180703063312.GA98572@erix.ericsson.se> Message-ID: How about this: (note: use whatever seeding you need) rand:seed(exsplus, {1,2,3}), AThousand = lists:seq(1, 1000), [[rand:uniform() || _ <- AThousand] || _ <- AThousand ] On Tue 3 Jul 2018 at 08:33, Raimo Niskanen < raimo+erlang-questions@REDACTED> wrote: > On Tue, Jul 03, 2018 at 01:15:17PM +0900, zxq9@REDACTED wrote: > > On 2018?7?2???? 23?36?10? JST Awsaf Rahman wrote: > > > Hello! > > > > > > I am trying to determine the execution time for my matrix > multiplication > > > program and for that I need to generate a large enough List of Lists of > > > random integers. Say I want to generate a matrix with a 1000 rows > (that is > > > 1000 lists inside a list). Is there any way of doing it? I can > generate a > > > list of random numbers using list comprehension but can't figure out > how to > > > go about building a list of lists. > > > > Wheels within wheels, man... > > > > -module(genset). > > -export([generate/1]). > > > > generate(Size) -> > > Generate = fun() -> rand:uniform(1000) end, > > MakeList = fun() -> populate(Generate, Size, []) end, > > populate(MakeList, Size, []). > > > > > > populate(_, Size, Acc) when Size < 0 -> > > Acc; > > populate(Generate, Size, Acc) -> > > populate(Generate, Size - 1, [Generate() | Acc]). > > > > > > -Craig > > This may be a missing function for the lists module: > > buildr(N, Fun, Acc) -> > buildr(N, Fun, Acc, []). > %% > buildr(0, _Fun, Acc, R) -> > {R, Acc}; > buildr(N, Fun, Acc, R) -> > {V, NewAcc} = Fun(Acc), > buildr(N - 1, Fun, NewAcc, [V|R]). > > Example usage: > > Base = 0, > Range = 1 bsl 32, > {ListOfLists, _NewSeed} = > buildr( > 1000, > fun (Seed) -> > buildr( > 1000, > %%fun rand:uniform_s/1, > fun (S) -> > {V, NewS} = rand:uniform_s(Range, S), > {Base + V - 1, NewS} > end, > Seed) > end, > rand:seed_s(exrop)), > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Cheers, -- Pierre Fenoll -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Tue Jul 3 09:24:10 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Tue, 03 Jul 2018 16:24:10 +0900 Subject: [erlang-questions] Generating a list of lists containing random numbers In-Reply-To: <4063921.JJgkbPxITg@takoyaki> References: <20180703063312.GA98572@erix.ericsson.se> <4063921.JJgkbPxITg@takoyaki> Message-ID: <1926837.Wka3KSlEUi@takoyaki> On 2018?7?3???? 16?08?18? JST zxq9@REDACTED wrote: > On 2018?7?3???? 8?33?12? JST Raimo Niskanen wrote: > > On Tue, Jul 03, 2018 at 01:15:17PM +0900, zxq9@REDACTED wrote: > > > On 2018?7?2???? 23?36?10? JST Awsaf Rahman wrote: > > > > Hello! > > > > > > > > I am trying to determine the execution time for my matrix multiplication > > > > program and for that I need to generate a large enough List of Lists of > > > > random integers. Say I want to generate a matrix with a 1000 rows (that is > > > > 1000 lists inside a list). Is there any way of doing it? I can generate a > > > > list of random numbers using list comprehension but can't figure out how to > > > > go about building a list of lists. > > > > > > Wheels within wheels, man... > > > > This may be a missing function for the lists module: > > I think I'd rather have matrix operations in a matrix module. > ... > > Would people be interested in a matrix_math library? I figured I could do a search and just find a native Erlang lib for this. Sadly, all I found in native Erlang was: 1- My blog post about matrix rotation and multiplication I mentioned earlier (evidently I posted it here https://zxq9.com/archives/1387 -- in all it's naive and assumptive glory) 2- A similar module that does a bit more but assumes a bit more as well https://github.com/majelbstoat/Morgana/blob/master/src/matrix.erl 3- A module that looks like it was intended as an escript that sort of freaks me out: http://dada.perl.it/shootout/matrix.erlang.html Not very comprehensive. The more comprehensive solutions are bindings to C/C++ libs like BLAS over CUDA, which are fine as long as you can build and run C/C++ code, but NIFs are not easy to deal with for anyone not running on *nix: https://github.com/vascokk/NumEr Hm. It seems like if there were a need for this that it would be covered already. Is it too niche to worry with? -Craig From alexd555@REDACTED Tue Jul 3 09:29:25 2018 From: alexd555@REDACTED (Alex Dashevski) Date: Tue, 3 Jul 2018 10:29:25 +0300 Subject: [erlang-questions] parallelize reduce step Message-ID: Hi, I want to parallelize reduce step: -module(phofs). -export([mapreduce/4]). -import(lists, [foreach/2]). %% F1(Pid, X) -> sends {Key,Val} messages to Pid %% F2(Key, [Val], AccIn) -> AccOut mapreduce(F1, F2, Acc0, L) -> S = self(), Pid= spawn(fun() -> reduce(S, F1, F2, Acc0, L) end), receive {Pid, Result} ->Result end. reduce(Parent, F1, F2, Acc0, L) -> process_flag(trap_exit, true), ReducePid= self(), foreach(fun(X) -> spawn_link(fun() -> F1(ReducePid, X) end) end, L), N = length(L), Dict0 = dict:new(), Dict1 = collect_replies(N, Dict0), Acc= dict:fold(F2, Acc0, Dict1), Parent ! {self(), Acc}. collect_replies(0, Dict) -> Dict; collect_replies(N, Dict) -> receive {Key, Val} -> case dict:is_key(Key, Dict) of true ->Dict1 = dict:append(Key, Val, Dict), collect_replies(N, Dict1); false ->Dict1 = dict:store(Key,[Val], Dict), collect_replies(N, Dict1) end; {'EXIT', _, Why} -> collect_replies(N-1, Dict) -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangsiri@REDACTED Tue Jul 3 12:32:59 2018 From: erlangsiri@REDACTED (Siri Hansen) Date: Tue, 3 Jul 2018 12:32:59 +0200 Subject: [erlang-questions] Node not responding to init:stop() In-Reply-To: References: Message-ID: Hi Roger, there's been a few changes in the shutdown procedure (init.erl) with the introduction of Logger in OTP-21. There are also some changes in the supervision tree of the Kernel application related to Logger. I don't know if this has anything to do with your problem, but the chances exist, of course. As you say, Kernel is the last application to be taken down (it's the last element in the #state.running of application_controller), and the state you see is probably stale in the sense that all applications listed before kernel in the 'running' list should already have been terminated. From the crash dump - can you see how many processes are still alive? Are they all part of kernel, or are there more applications that did not completely terminate? And if we are to look closer at the logger track - do you know which logger handlers were active? Are there any children under the logger_sup supervisor, and if so, what are their state? You mention lager above, do you know how lager and logger are connected (is lager a handler under logger, or does it run independently)? If you see anything suspicious related to logger, please feel free to send me the crash dump off-list, and I'll see if I can figure out anything more. Regards /siri Den man. 2. jul. 2018 kl. 18:24 skrev Roger Lipscombe < roger@REDACTED>: > Right, so I've done some digging. I got a crash dump and by looking at > the stack trace for application_controller, I can see that it's > hanging in application_controller:terminate, presumably while waiting > for one of the processes to stop. The pid given is <0.893.0>. Looking > a bit further up the stack trace gets me the process state (possibly > stale?), which contains a bunch of applications and pids. The pid it's > hanging on is 'kernel', which I'd expect to be the last (?) > application to be shut down. The process state (assuming it's not > stale) has a load of other applications in there with pids. There are > a bunch of ours, but also others, such as runtime_tools, cowboy, > amqp_client, hackney, lager, etc. > > Is any of this useful in finding out why it's hanging? > > On 2 July 2018 at 16:54, Roger Lipscombe wrote: > > This sounds similar to > > http://erlang.org/pipermail/erlang-questions/2012-December/071223.html, > > but it's not quite the same, as far as I can tell. > > > > I've noticed that, at some point since upgrading from OTP-20.3 to > > OTP-21.0 (along with the necessary dependency updates), my Erlang > > nodes are no longer stopping at the end of our system test run. > > > > The nodes are orchestrated by having 'erlexec' run a bash script which > > uses (effectively) 'foo/bin/foo foreground &'. I'm relying on erlexec > > killing the bash script and that killing the nodes. This works fine > > when the nodes are using OTP-20.3, but not with OTP-21.0. > > > > If I connect to the node, I can issue 'init:stop()', and it returns > > ok, but nothing happens. If I use 'application:which_applications()', > > I get a timeout. > > > > Unlike the linked discussion, I _can_ repeatedly connect a remote > > shell (using erl -remsh), but I have to resort to erlang:halt() to > > stop the node. Since my system test environment relies on orderly > > process group teardown to stop the nodes, that's not useful. > > > > As I understand it, process group teardown results in SIGTERM, which > > results in a call to init:stop, which should stop the node. It isn't. > > > > How do I figure out why init:stop() isn't working? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raimo+erlang-questions@REDACTED Tue Jul 3 12:42:01 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Tue, 3 Jul 2018 12:42:01 +0200 Subject: [erlang-questions] Generating a list of lists containing random numbers In-Reply-To: <4063921.JJgkbPxITg@takoyaki> References: <4957339.naqcQyKLIm@takoyaki> <20180703063312.GA98572@erix.ericsson.se> <4063921.JJgkbPxITg@takoyaki> Message-ID: <20180703104201.GA20806@erix.ericsson.se> On Tue, Jul 03, 2018 at 04:08:18PM +0900, zxq9@REDACTED wrote: > On 2018?7?3???? 8?33?12? JST Raimo Niskanen wrote: : : > > This may be a missing function for the lists module: > > > > buildr(N, Fun, Acc) -> > > buildr(N, Fun, Acc, []). > > %% > > buildr(0, _Fun, Acc, R) -> > > {R, Acc}; > > buildr(N, Fun, Acc, R) -> > > {V, NewAcc} = Fun(Acc), > > buildr(N - 1, Fun, NewAcc, [V|R]). > > > > Example usage: > > > > Base = 0, > > Range = 1 bsl 32, > > {ListOfLists, _NewSeed} = > > buildr( > > 1000, > > fun (Seed) -> > > buildr( > > 1000, > > %%fun rand:uniform_s/1, > > fun (S) -> > > {V, NewS} = rand:uniform_s(Range, S), > > {Base + V - 1, NewS} > > end, > > Seed) > > end, > > rand:seed_s(exrop)), > > > > > > I think I'd rather have matrix operations in a matrix module. This is not a matrix operation. We have lists:seq/2,3 and lists:duplicate/2 but no such generating function that takes a generator fun. It could be named generate/3, gen/3 or build/3. I suggested buildr/3 because it builds from the right end of the list analogous to foldr/3. A buildl/3 would be more inefficient since it should return {List,Acc} which does not allow for a recursive variant so it would become build3/r followed by reverse/1. So: lists:buildr(N, GeneratorFun, Acc) -> {List, NewAcc} with: GeneratorFun(Acc) -> {Value, NewAcc} Might be useful enough to add... > > Every time I've needed to do matrix operations the need has either been: > > 1) > Trivial, flat matrix operations over regular matrices of regular > dimensions populated by scalar values & a well-defined _|_. > > OR > > 2) > Matrices that are specialized enough that they really deserve a custom > set of handlers all their own. In Wings3D I wrote a matrix library that was optimized for sparse matrixes, for the automatic U-V mapping algorithm. Yet another specialized matrix library I guess... / Raimo > > In case 1 there are enough regular operations (especially against numeric > values) that you could fill out a full-blown matrix_math module and still > not cover everything. I wouldn't want that to clutter the lists module. > > In case 2 trying to generalize is futile because remembering the details > of the abstractions involved is more trouble than writing a special handler, > hence things like this: > https://gitlab.com/zxq9/zxWidgets/blob/master/src/zxw.erl#L194 > > I wouldn't want to attempt to generalize a text grid metawidget generator > because the assumptions embedded in it will break in any other situation, > but nonetheless, it is a matrix operation to generate, populate, and extract > or modify data in it. > > I've got a naive matrix math module around here somewhere that I wrote as > an example for a guy on SO a while back... but it only handles a few math > operations, flips, inversions and rotations. > > Would people be interested in a matrix_math library? > > -Craig > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From roger@REDACTED Tue Jul 3 13:45:30 2018 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 3 Jul 2018 12:45:30 +0100 Subject: [erlang-questions] Node not responding to init:stop() In-Reply-To: References: Message-ID: Before I go looking for permission to release the crash dump (it'll take at least a couple of hours; I'll ask), let's see what we can figure out from here. There are 44 processes alive. Most of them look fairly innocuous, but, in terms of logger, I see: - A process <0.2130.0> sitting in erlang:apply, issuing error_logger:stop, which is a gen_server:call, timeout infinity, to <0.927.0>. Stack is logger_server:'-call_h_async/4-fun-0-'/2 + 152 -> logger_server:call_h/4 + 96 -> error_logger:removing_handler/1 + 112 -> error_logger:stop/0 + 72 - <0.927.0> is 'logger_sup'; it appears to be trying to call <0.890.0>, which is 'logger'. - <0.890.0> is, apparently, sitting in proc_lib:init_p_do_apply/3 I suspect that logger_sup has failed in supervisor:do_terminate, and is attempting to report an error, via logger (which is problematic, I guess). I see the following on the logger_sup stack: #{level => error, meta => #{domain => [otp,sasl], error_logger => #{tag => error_report,type => supervisor_report}, file => "supervisor.erl", gl => <0.894.0>, line => 838, logger_formatter => #{title => "SUPERVISOR REPORT"}, mfa => {supervisor,do_terminate,2}, pid => <0.927.0>, report_cb => fun logger:format_otp_report/1,time => 1530616282326266}, msg => {report,#{label => {supervisor,shutdown_error}, report => [{supervisor,{local,logger_sup}}, {errorContext,shutdown_error}, {reason,killed}, {offender,[{pid,<0.929.0>}, {id,default}, {mfargs,{logger_std_h,start_link,undefined}}, {restart_type,temporary}, {shutdown,2000}, {child_type,worker}]}]}}} At this point, logger_sup has zero links, is monitoring 'logger' and is monitored by kernel_sup and the process that's calling error_logger:stop. For a *running* node, I get: 1> supervisor:which_children(logger_sup). [{error_logger,<0.1023.0>,worker,dynamic}, {default,<0.929.0>,worker,[logger_std_h]}] Assuming that the low process IDs are relatively stable, that <0.929.0> for the default logger correlates with the offender in the ?reportError above. I *believe* that lager's running independently. That is: I've done nothing deliberate to connect the two. I'm using lager 3.6.3. Thanks, Roger. On 3 July 2018 at 11:32, Siri Hansen wrote: > Hi Roger, > > there's been a few changes in the shutdown procedure (init.erl) with the > introduction of Logger in OTP-21. There are also some changes in the > supervision tree of the Kernel application related to Logger. I don't know > if this has anything to do with your problem, but the chances exist, of > course. > > As you say, Kernel is the last application to be taken down (it's the last > element in the #state.running of application_controller), and the state you > see is probably stale in the sense that all applications listed before > kernel in the 'running' list should already have been terminated. From the > crash dump - can you see how many processes are still alive? Are they all > part of kernel, or are there more applications that did not completely > terminate? > > And if we are to look closer at the logger track - do you know which logger > handlers were active? Are there any children under the logger_sup > supervisor, and if so, what are their state? You mention lager above, do you > know how lager and logger are connected (is lager a handler under logger, or > does it run independently)? > > If you see anything suspicious related to logger, please feel free to send > me the crash dump off-list, and I'll see if I can figure out anything more. > > Regards > /siri > > > > Den man. 2. jul. 2018 kl. 18:24 skrev Roger Lipscombe > : >> >> Right, so I've done some digging. I got a crash dump and by looking at >> the stack trace for application_controller, I can see that it's >> hanging in application_controller:terminate, presumably while waiting >> for one of the processes to stop. The pid given is <0.893.0>. Looking >> a bit further up the stack trace gets me the process state (possibly >> stale?), which contains a bunch of applications and pids. The pid it's >> hanging on is 'kernel', which I'd expect to be the last (?) >> application to be shut down. The process state (assuming it's not >> stale) has a load of other applications in there with pids. There are >> a bunch of ours, but also others, such as runtime_tools, cowboy, >> amqp_client, hackney, lager, etc. >> >> Is any of this useful in finding out why it's hanging? >> >> On 2 July 2018 at 16:54, Roger Lipscombe wrote: >> > This sounds similar to >> > http://erlang.org/pipermail/erlang-questions/2012-December/071223.html, >> > but it's not quite the same, as far as I can tell. >> > >> > I've noticed that, at some point since upgrading from OTP-20.3 to >> > OTP-21.0 (along with the necessary dependency updates), my Erlang >> > nodes are no longer stopping at the end of our system test run. >> > >> > The nodes are orchestrated by having 'erlexec' run a bash script which >> > uses (effectively) 'foo/bin/foo foreground &'. I'm relying on erlexec >> > killing the bash script and that killing the nodes. This works fine >> > when the nodes are using OTP-20.3, but not with OTP-21.0. >> > >> > If I connect to the node, I can issue 'init:stop()', and it returns >> > ok, but nothing happens. If I use 'application:which_applications()', >> > I get a timeout. >> > >> > Unlike the linked discussion, I _can_ repeatedly connect a remote >> > shell (using erl -remsh), but I have to resort to erlang:halt() to >> > stop the node. Since my system test environment relies on orderly >> > process group teardown to stop the nodes, that's not useful. >> > >> > As I understand it, process group teardown results in SIGTERM, which >> > results in a call to init:stop, which should stop the node. It isn't. >> > >> > How do I figure out why init:stop() isn't working? >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From roger@REDACTED Tue Jul 3 13:48:16 2018 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 3 Jul 2018 12:48:16 +0100 Subject: [erlang-questions] Node not responding to init:stop() In-Reply-To: References: Message-ID: Note that I can reproduce this consistently, so if there's any experimentation (tracing, patches, etc.) you want me to try, I should be able to do that. On 3 July 2018 at 12:45, Roger Lipscombe wrote: > Before I go looking for permission to release the crash dump (it'll > take at least a couple of hours; I'll ask), let's see what we can > figure out from here. > > There are 44 processes alive. Most of them look fairly innocuous, but, > in terms of logger, I see: > > - A process <0.2130.0> sitting in erlang:apply, issuing > error_logger:stop, which is a gen_server:call, timeout infinity, to > <0.927.0>. Stack is logger_server:'-call_h_async/4-fun-0-'/2 + 152 -> > logger_server:call_h/4 + 96 -> error_logger:removing_handler/1 + 112 > -> error_logger:stop/0 + 72 > - <0.927.0> is 'logger_sup'; it appears to be trying to call > <0.890.0>, which is 'logger'. > - <0.890.0> is, apparently, sitting in proc_lib:init_p_do_apply/3 > > I suspect that logger_sup has failed in supervisor:do_terminate, and > is attempting to report an error, via logger (which is problematic, I > guess). I see the following on the logger_sup stack: > > #{level => error, > meta => > #{domain => [otp,sasl], > error_logger => #{tag => error_report,type => supervisor_report}, > file => "supervisor.erl", > gl => <0.894.0>, > line => 838, > logger_formatter => #{title => "SUPERVISOR REPORT"}, > mfa => {supervisor,do_terminate,2}, > pid => <0.927.0>, > report_cb => fun logger:format_otp_report/1,time => 1530616282326266}, > msg => > {report,#{label => {supervisor,shutdown_error}, > report => > [{supervisor,{local,logger_sup}}, > {errorContext,shutdown_error}, > {reason,killed}, > {offender,[{pid,<0.929.0>}, > {id,default}, > {mfargs,{logger_std_h,start_link,undefined}}, > {restart_type,temporary}, > {shutdown,2000}, > {child_type,worker}]}]}}} > > At this point, logger_sup has zero links, is monitoring 'logger' and > is monitored by kernel_sup and the process that's calling > error_logger:stop. > > For a *running* node, I get: > > 1> supervisor:which_children(logger_sup). > [{error_logger,<0.1023.0>,worker,dynamic}, > {default,<0.929.0>,worker,[logger_std_h]}] > > Assuming that the low process IDs are relatively stable, that > <0.929.0> for the default logger correlates with the offender in the > ?reportError above. > > I *believe* that lager's running independently. That is: I've done > nothing deliberate to connect the two. I'm using lager 3.6.3. > > Thanks, > Roger. > > On 3 July 2018 at 11:32, Siri Hansen wrote: >> Hi Roger, >> >> there's been a few changes in the shutdown procedure (init.erl) with the >> introduction of Logger in OTP-21. There are also some changes in the >> supervision tree of the Kernel application related to Logger. I don't know >> if this has anything to do with your problem, but the chances exist, of >> course. >> >> As you say, Kernel is the last application to be taken down (it's the last >> element in the #state.running of application_controller), and the state you >> see is probably stale in the sense that all applications listed before >> kernel in the 'running' list should already have been terminated. From the >> crash dump - can you see how many processes are still alive? Are they all >> part of kernel, or are there more applications that did not completely >> terminate? >> >> And if we are to look closer at the logger track - do you know which logger >> handlers were active? Are there any children under the logger_sup >> supervisor, and if so, what are their state? You mention lager above, do you >> know how lager and logger are connected (is lager a handler under logger, or >> does it run independently)? >> >> If you see anything suspicious related to logger, please feel free to send >> me the crash dump off-list, and I'll see if I can figure out anything more. >> >> Regards >> /siri >> >> >> >> Den man. 2. jul. 2018 kl. 18:24 skrev Roger Lipscombe >> : >>> >>> Right, so I've done some digging. I got a crash dump and by looking at >>> the stack trace for application_controller, I can see that it's >>> hanging in application_controller:terminate, presumably while waiting >>> for one of the processes to stop. The pid given is <0.893.0>. Looking >>> a bit further up the stack trace gets me the process state (possibly >>> stale?), which contains a bunch of applications and pids. The pid it's >>> hanging on is 'kernel', which I'd expect to be the last (?) >>> application to be shut down. The process state (assuming it's not >>> stale) has a load of other applications in there with pids. There are >>> a bunch of ours, but also others, such as runtime_tools, cowboy, >>> amqp_client, hackney, lager, etc. >>> >>> Is any of this useful in finding out why it's hanging? >>> >>> On 2 July 2018 at 16:54, Roger Lipscombe wrote: >>> > This sounds similar to >>> > http://erlang.org/pipermail/erlang-questions/2012-December/071223.html, >>> > but it's not quite the same, as far as I can tell. >>> > >>> > I've noticed that, at some point since upgrading from OTP-20.3 to >>> > OTP-21.0 (along with the necessary dependency updates), my Erlang >>> > nodes are no longer stopping at the end of our system test run. >>> > >>> > The nodes are orchestrated by having 'erlexec' run a bash script which >>> > uses (effectively) 'foo/bin/foo foreground &'. I'm relying on erlexec >>> > killing the bash script and that killing the nodes. This works fine >>> > when the nodes are using OTP-20.3, but not with OTP-21.0. >>> > >>> > If I connect to the node, I can issue 'init:stop()', and it returns >>> > ok, but nothing happens. If I use 'application:which_applications()', >>> > I get a timeout. >>> > >>> > Unlike the linked discussion, I _can_ repeatedly connect a remote >>> > shell (using erl -remsh), but I have to resort to erlang:halt() to >>> > stop the node. Since my system test environment relies on orderly >>> > process group teardown to stop the nodes, that's not useful. >>> > >>> > As I understand it, process group teardown results in SIGTERM, which >>> > results in a call to init:stop, which should stop the node. It isn't. >>> > >>> > How do I figure out why init:stop() isn't working? >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions From cean.ebengt@REDACTED Tue Jul 3 20:52:10 2018 From: cean.ebengt@REDACTED (bengt) Date: Tue, 3 Jul 2018 20:52:10 +0200 Subject: [erlang-questions] Idly wondering why this code in common test suite, init_per_suite/1 works Message-ID: <0F5401D3-B8E0-4C9F-A324-99AA10EA537F@gmail.com> Greetings, If somebody happens to know, otherwise ignore. I can read the source myself. 1) If I use start_link() from my test suites init_per_suite/1,then the gen_server is dead in the test cases. 2) This made me either use gen_server:start(), or if the coding guidelines insist upon placing the start_link() inside the gen_server callback module, the following: init_per_suite(Config) -> P = erlang:spawn( fun() -> {ok, _} = mm:start_link(), receive end_per_suite -> ok end end ), [{mm_pid, P} | Config]. In end_per_suite/1 I then send end_per_suite to Pid and the process exits. Probably taking the gen_server with it. Unless it is trapping exists etc? But this one is not. Today I forgot the receive statement . Like this: init_per_suite(Config) -> P = erlang:spawn( fun() -> {ok, _} = mm:start_link( ), end ), [{mm_pid, P}|Config]. And it still worked. Why? Is this not the same thing when the spawned fun returns, as when init_per_suite/1 returned without spawning (in 1)? Surprised, bengt From thom.cherryhomes@REDACTED Tue Jul 3 23:34:18 2018 From: thom.cherryhomes@REDACTED (Thom Cherryhomes) Date: Tue, 3 Jul 2018 16:34:18 -0500 Subject: [erlang-questions] tcp-forwarding example? Message-ID: Has anyone got an example of a TCP forwarding server? -Thom -------------- next part -------------- An HTML attachment was scrubbed... URL: From john@REDACTED Wed Jul 4 09:57:21 2018 From: john@REDACTED (John =?ISO-8859-1?Q?H=F6gberg?=) Date: Wed, 4 Jul 2018 09:57:21 +0200 Subject: [erlang-questions] Patch package OTP 21.0.2 released Message-ID: <1530691041.9559.1.camel@erlang.org> Patch Package:???????????OTP 21.0.2 Git Tag:?????????????????OTP-21.0.2 Date:????????????????????2018-07-04 Trouble Report Id:???????OTP-15067, OTP-15151, OTP-15156, OTP-15157, ?????????????????????????OTP-15158, OTP-15159, OTP-15166 Seq num:?????????????????ERL-573, ERL-654, ERL-655, ERL-660 System:??????????????????OTP Release:?????????????????21 Application:?????????????compiler-7.2.2, erts-10.0.2, ?????????????????????????public_key-1.6.1, stdlib-3.5.1 Predecessor:?????????????OTP 21.0.1 ?Check out the git tag OTP-21.0.2, 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. ?--------------------------------------------------------------------- ?--- compiler-7.2.2 -------------------------------------------------- ?--------------------------------------------------------------------- ?The compiler-7.2.2 application can be applied independently of other ?applications on a full OTP 21 installation. ?--- Fixed Bugs and Malfunctions --- ? OTP-15156????Application(s): compiler ???????????????Related Id(s): ERL-655 ???????????????In rare cases involving matching of binary literal ???????????????strings, the compiler could optimize away code that ???????????????should be executed. ? OTP-15157????Application(s): compiler ???????????????There could be an internal consistency check failure ???????????????when compiling code that called map_get(Key, Map) and ???????????????then updated the same map. ? OTP-15166????Application(s): compiler ???????????????Related Id(s): ERL-660 ???????????????In rare circumstances, the compiler could crash in ???????????????beam_jump when compiling a floating point operation. ?Full runtime dependencies of compiler-7.2.2: crypto-3.6, erts-9.0, ?hipe-3.12, kernel-4.0, stdlib-2.5 ?--------------------------------------------------------------------- ?--- erts-10.0.2 ----------------------------------------------------- ?--------------------------------------------------------------------- ?The erts-10.0.2 application can be applied independently of other ?applications on a full OTP 21 installation. ?--- Fixed Bugs and Malfunctions --- ? OTP-15067????Application(s): erts ???????????????Related Id(s): ERL-573 ???????????????Fixed a rare bug that could cause processes to be ???????????????scheduled after they had been freed. ? OTP-15158????Application(s): erts ???????????????Related Id(s): ERL-654 ???????????????Fixed a race condition in the inet driver that could ???????????????cause receive to hang when the emulator was compiled ???????????????with gcc 8. ?Full runtime dependencies of erts-10.0.2: kernel-6.0, sasl-3.0.1, ?stdlib-3.5 ?--------------------------------------------------------------------- ?--- public_key-1.6.1 ------------------------------------------------ ?--------------------------------------------------------------------- ?The public_key-1.6.1 application can be applied independently of ?other applications on a full OTP 21 installation. ?--- Fixed Bugs and Malfunctions --- ? OTP-15151????Application(s): public_key ???????????????Related Id(s): OTP-15113 ???????????????Some of the keylengths in the newly generated moduli ???????????????file in public_key are not universally supported. This ???????????????could cause the SSH key exchange ???????????????diffie-hellman-group-exchange-sha* to fail. ???????????????Those keylengths are now removed. ?Full runtime dependencies of public_key-1.6.1: asn1-3.0, crypto-3.8, ?erts-6.0, kernel-3.0, stdlib-3.5 ?--------------------------------------------------------------------- ?--- stdlib-3.5.1 ---------------------------------------------------- ?--------------------------------------------------------------------- ?The stdlib-3.5.1 application can be applied independently of other ?applications on a full OTP 21 installation. ?--- Fixed Bugs and Malfunctions --- ? OTP-15159????Application(s): stdlib ???????????????Fix a bug that could cause a crash when formatting a ???????????????list of non-characters using the control sequences p or ???????????????P and limiting the output with the option chars_limit. ?Full runtime dependencies of stdlib-3.5.1: compiler-5.0, crypto-3.3, ?erts-10.0, kernel-6.0, sasl-3.0 ?--------------------------------------------------------------------- ?--------------------------------------------------------------------- ?--------------------------------------------------------------------- From bchesneau@REDACTED Wed Jul 4 12:49:40 2018 From: bchesneau@REDACTED (Benoit Chesneau) Date: Wed, 4 Jul 2018 12:49:40 +0200 Subject: [erlang-questions] term_to_binary and large data structures In-Reply-To: References: <2415009.ysGbzmeS8O@takoyaki> Message-ID: also https://gitlab.com/barrel-db/teleport On Wednesday, June 27, 2018, Chandru wrote: > On 27 June 2018 at 15:39, wrote: > >> On 2018?6?27???? 16?19?14? JST Aaron Seigo wrote: >> > Hello! :) >> > >> > I have a distributed (in the Erlang sense) application which often >> > produces moderately-sized maps (10k+ entries with lots of tuples in the >> > mix) which in the past have given inter-node message passing serious >> > problems: the vm would lock for a long while, use several GB of RAM, >> and >> > usually eventually give up. When it didn't outright crash, it would >> > produce message sizes too big to send between nodes, and/or the >> > heartbeat messages between nodes would time out resulting in breakage. >> > Running the same terms through `term_to_binary` produces similar >> > results. >> >> If you're using disterl keep in mind that inter-node heartbeats operate >> on the same channel as intern-node messages. >> >> If you send huge messages you are killing your heartbeats. That doesn't >> play out very well. >> >> The *correct* solution would be to make disterl operate over SCTP, but in >> reality SCTP isn't supported well enough cross-platform to make for a >> universal option (thanks, Microsoft). >> >> Instead, consider opening a separate TCP connection between nodes for >> tranfer of large data. That way heartbeats and small inter-node messages >> don't interfere with your huge bulk message transfers. >> >> (Yes, this is totally the kind of thing that there should be a library >> for, but it isn't something there is a lot of time for unpaid work on. >> That sucks, but there it is.) >> >> > There are a few libraries which offer this functionality. Here are two I > know of. > > https://github.com/priestjim/gen_rpc > > https://github.com/Bluehouse-Technology/erpc > > Chandru > > > -- Sent from my Mobile -------------- next part -------------- An HTML attachment was scrubbed... URL: From tty.erlang@REDACTED Wed Jul 4 12:54:27 2018 From: tty.erlang@REDACTED (T Ty) Date: Wed, 4 Jul 2018 11:54:27 +0100 Subject: [erlang-questions] term_to_binary and large data structures In-Reply-To: References: <2415009.ysGbzmeS8O@takoyaki> Message-ID: also Ethernet Bonding. On Wed, Jul 4, 2018 at 11:49 AM, Benoit Chesneau wrote: > also https://gitlab.com/barrel-db/teleport > > > > On Wednesday, June 27, 2018, Chandru > wrote: > >> On 27 June 2018 at 15:39, wrote: >> >>> On 2018?6?27???? 16?19?14? JST Aaron Seigo wrote: >>> > Hello! :) >>> > >>> > I have a distributed (in the Erlang sense) application which often >>> > produces moderately-sized maps (10k+ entries with lots of tuples in >>> the >>> > mix) which in the past have given inter-node message passing serious >>> > problems: the vm would lock for a long while, use several GB of RAM, >>> and >>> > usually eventually give up. When it didn't outright crash, it would >>> > produce message sizes too big to send between nodes, and/or the >>> > heartbeat messages between nodes would time out resulting in breakage. >>> > Running the same terms through `term_to_binary` produces similar >>> > results. >>> >>> If you're using disterl keep in mind that inter-node heartbeats operate >>> on the same channel as intern-node messages. >>> >>> If you send huge messages you are killing your heartbeats. That doesn't >>> play out very well. >>> >>> The *correct* solution would be to make disterl operate over SCTP, but in >>> reality SCTP isn't supported well enough cross-platform to make for a >>> universal option (thanks, Microsoft). >>> >>> Instead, consider opening a separate TCP connection between nodes for >>> tranfer of large data. That way heartbeats and small inter-node messages >>> don't interfere with your huge bulk message transfers. >>> >>> (Yes, this is totally the kind of thing that there should be a library >>> for, but it isn't something there is a lot of time for unpaid work on. >>> That sucks, but there it is.) >>> >>> >> There are a few libraries which offer this functionality. Here are two I >> know of. >> >> https://github.com/priestjim/gen_rpc >> >> https://github.com/Bluehouse-Technology/erpc >> >> Chandru >> >> >> > > -- > Sent from my Mobile > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From michal@REDACTED Wed Jul 4 13:23:15 2018 From: michal@REDACTED (=?utf-8?Q?Micha=C5=82_Muska=C5=82a?=) Date: Wed, 4 Jul 2018 13:23:15 +0200 Subject: [erlang-questions] term_to_binary and large data structures In-Reply-To: <131a8c8d06640db106b71fd1ef246fe7@mykolab.com> References: <131a8c8d06640db106b71fd1ef246fe7@mykolab.com> Message-ID: <81bb5c98-5a6a-4069-91d9-9cbd3eba662c@Spark> I also believe the current format for maps, which is key1, value1, key2, value2, ... is not that great for compression. Often, you'd have maps with exact the same keys (especially in Elixir with structs), and there, a pattern of key1, key2, ..., value1, value2, ..., should be much better (since the entire keys structure could be compressed between similar maps). Micha?. On 28 Jun 2018, 07:36 +0200, Aaron Seigo , wrote: > On 2018-06-28 07:03, Dmitry Belyaev wrote: > > So it's not so bad as it's stated in the file, only 33 time worse than > > the advertised > > format. > > My bad; this came from a run of performance tests where the size of them > map is increased incrementally. It is missing a zero in one of the > lines; will fix. > > > However after applying [compressed: 9] suggested by Fred Hebert, I see: > > > > iex(6)> :erlang.term_to_binary(tuple_map, compressed: 9) |> byte_size() > > |> (fn x -> x / 1024 / 1024 end).() > > 0.38570117950439453 > > There are three problems with this: > > a) that data does get decompressed at some point. It doesn't magically > go away. It does, however, help with network usage. > > b) we trade time (to compress) for space (fewer byte to transmit), when > that space isn't needed in the first place. The time required to > compress, esp relative to the serialization time, is decidedly > non-trivial. It takes several times as long to compress with zlib than > it does to serialize. This could be improved by moving a more modern > compression algorithm, though the cost is always non-zero of course. In > our tests, it definitely paid to compress the actual data in the map, > but there was very little need to compress the structural metadata when > encoded efficiently. > > c) we don't always control the call to term_to_binary, or the equivalent > eternal term generators, and so don't have access to compression e.g. on > distribution messages > > I suppose we could propose using compression on (larger) distribution > messages, which would help with the network saturation, and would be a > better stop-gap than nothing, but it still leaves us with (a) and (b) > above (and , and (c) everywhere else. > > -- > Aaron > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From aseigo@REDACTED Wed Jul 4 14:56:08 2018 From: aseigo@REDACTED (Aaron Seigo) Date: Wed, 04 Jul 2018 14:56:08 +0200 Subject: [erlang-questions] term_to_binary and large data structures In-Reply-To: <81bb5c98-5a6a-4069-91d9-9cbd3eba662c@Spark> References: <131a8c8d06640db106b71fd1ef246fe7@mykolab.com> <81bb5c98-5a6a-4069-91d9-9cbd3eba662c@Spark> Message-ID: <78b98aa2f5173e40bda7d30ce73dd929@mykolab.com> On 2018-07-04 13:23, Micha? Muska?a wrote: > I also believe the current format for maps, which is key1, value1, > key2, value2, ... is > not that great for compression. Often, you'd have maps with exact the > same keys > (especially in Elixir with structs), and there, a pattern of key1, > key2, ..., value1, > value2, ..., should be much better (since the entire keys structure > could be compressed > between similar maps). I can confirm that this is an accurate observation. While not done in Packer, there are notes about this in Packer's code which was the result of some experiments around this. For maps, and *especially* structs in Elixir, this can indeed be a huge win for some messages. Even more farther afield: what would be a real win, but much harder to accomplish, would be streaming compression. There are protocols (e.g. imap) which can offload compression of common patterns between messages to entries in the compression look up tables. The compression is applied to the entire network stream for the life of the connection and all data that goes through it is compressed in a single stream. So when a message has the same byte sequence as a previous message the comrpessor ends up turning that into a reference to an already existing entry in a look-up table. The hard(er) part for BEAM distribution and this sort of thing would be managing the size of the lookup table as these connections are meant to be both long-lived and not consume infinite resources ;) So unlike (relatively) short-lived and highly repetitive imap connections, this would probably require something custom made to task which would keep a cache of most used terms (with all that comes with that, including cache invalidation). Compared to just working on the term serialization, that feels a bit like rocket science at the moment. But getting maps in the same message more efficiently packed is definitely doable :) -- Aaron From empro2@REDACTED Wed Jul 4 14:03:42 2018 From: empro2@REDACTED (empro2@REDACTED) Date: Wed, 4 Jul 2018 14:03:42 +0200 Subject: [erlang-questions] Generating a list of lists containing random numbers In-Reply-To: References: Message-ID: <20180704140342.02536c66@raspy> Are lists not collections of varying size, that tend to grow or shrink? (there is a tuple_size/1 but no lists:size/1) and to contain things of not necessarily the same type? (e. g. proplists)? Are vectors and matrices not of rather fixed dimensions and tend to contain similar things (e. g. R^3, or in this thread R^1000, or Z^1000, or N^1000)? When I think "matrix", things that come to mind are: * {...} (tuple) and element(3, element(2, M)) and setelement/3, ..., * stdlib's array:get(3, array:get(2, A)), * and in this case especially: array:map(Fun, A). But these are just some stranger's thoughts ... Michael -- That, which was said, is not that, which was spoken, but that, which was understood; and none of these necessarily comes close to that, which was meant. From hugo@REDACTED Wed Jul 4 15:19:27 2018 From: hugo@REDACTED (Hugo Mills) Date: Wed, 4 Jul 2018 13:19:27 +0000 Subject: [erlang-questions] Generating a list of lists containing random numbers In-Reply-To: <20180704140342.02536c66@raspy> References: <20180704140342.02536c66@raspy> Message-ID: <20180704131927.GC7297@carfax.org.uk> On Wed, Jul 04, 2018 at 02:03:42PM +0200, empro2@REDACTED wrote: > Are lists not collections of varying size, that tend to grow > or shrink? (there is a tuple_size/1 but no lists:size/1) > and to contain things of not necessarily the same type? (e. > g. proplists)? > > Are vectors and matrices not of rather fixed dimensions and > tend to contain similar things (e. g. R^3, or in this thread > R^1000, or Z^1000, or N^1000)? > > When I think "matrix", things that come to mind are: > > * {...} (tuple) and element(3, element(2, M)) and > setelement/3, ..., > > * stdlib's array:get(3, array:get(2, A)), > > * and in this case especially: array:map(Fun, A). > > But these are just some stranger's thoughts ... Most numerics libraries use single-dimensional lists for storage, and turn the (i, j) locations of the matrix into (i*width+j) to look it up in the list, because it's generally more efficient to do so with random-access data. If you look at the numerics libraries, the general assumption is that you have linear random-access storage of the data, and then a thin translation layer on top of that which converts (i, j) coordinates to the linear location. Note also that there are generalisations to matrices which have more than two indices (and are hence written as n*m*p*q*... objects), which are used in some things like general relativity. These are handled in exactly the same way, with a slightly different, but generalisable, translation function. There are definitely algorithms which require taking slices out of matrices, for example, building the (n-1)*(n-1) matrix consisting of every row that isn't row i, and every column that isn't column j of some n*n matrix. Similarly, there are some algorithms which use block decompositions of matrices (say, the four n/2*n/2 square matrices making up the whole n*n). Both of these can be done quite easily by, again, generating specific translation functions to map to the underlying linear matrix. So, as long as you can do a linear random-access storage unit (probably what erlang's array module was designed for in the first place), you can build all fo the useful things on top of that with appropriate [stacks of] coordinate translation functions. Hugo. -- Hugo Mills | Stick them with the pointy end. hugo@REDACTED carfax.org.uk | http://carfax.org.uk/ | PGP: E2AB1DE4 | Jon Snow -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 836 bytes Desc: Digital signature URL: From erlang@REDACTED Wed Jul 4 16:07:46 2018 From: erlang@REDACTED (Stefan Marr) Date: Wed, 4 Jul 2018 15:07:46 +0100 Subject: [erlang-questions] =?utf-8?q?=5BCFP=5D_Workshop_on_Virtual_Machin?= =?utf-8?q?es_and_Language_Implementations_=28VMIL=E2=80=9918=29?= Message-ID: <735E40EE-A86C-4BF1-A7B8-B35384C32B08@stefan-marr.de> ======================================================================== Call for Papers Workshop on Virtual Machines and Language Implementations (VMIL?18) Co-located with SPLASH 2018 November 4, 2018, Boston, USA https://2018.splashcon.org/track/vmil-2018 Follow us on twitter @vmil18 ======================================================================== The concept of virtual machines is pervasive in the design and implementation of programming systems. Virtual machines and the languages they implement are crucial in the specification, implementation and/or user-facing deployment of most programming technologies. The VMIL workshop is a forum for researchers and cutting-edge practitioners in language virtual machines, the intermediate languages they use, and related issues. The workshop is intended to be welcoming to a wide range of topics and perspectives, covering all areas relevant to the workshop?s theme. Aspects of interest include, but are not limited to: - design issues in VMs and IRs (e.g. IR design, VM modularity, polyglotism) - compilation (static and dynamic compilation strategies, optimizations, data representations) - memory management - concurrency (both internal and user-facing) - tool support and related infrastructure (profiling, debugging, liveness, persistence) - the experience of VM development (use of high-level languages, bootstrapping and self-hosting, reusability, portability, developer tooling, etc) - empirical studies on related topics, such as usage patterns, the usability of languages or tools, experimental methodology, or benchmark design #### Submission Guidelines We invite high-quality papers in the following two categories: Research and experience papers: These submissions should describe work that advances the current state of the art in the above or related areas. The suggested length of these submissions is 6-10 pages (maximum 10pp). Work-in-progress or position papers: These papers should document ongoing efforts in an area of interest which have not yet yielded final results, and/or should present and defend the authors' position on a topic related to the broad area of the workshop. The suggested length of these submissions is 4-6 pages (maximum 6pp). For the first submission deadline, all paper types are considered for publication in the ACM Digital Library, except if the authors prefer not to be included. Publication of work-in-progress and position papers at VMIL is not intended to preclude later publication elsewhere. Submissions will be judged on novelty, clarity, timeliness, relevance, and potential to stimulate discussion during the workshop. For the second deadline, we will consider only work-in-progress and position papers. These will not be published in the ACM DL, and will only appear on the web site. The address of the submission site is: https://vmil18.hotcrp.com/ #### Important Dates All deadlines are Anywhere on Earth (AoE), i.e. GMT/UTC?12:00 hour Abstract Submission 07 August 2018 Paper Submission 17 August 2018 Paper Notification 14 September 2018 ACM Camera Ready Deadline 28 September 2018 ?Late submission? deadline 07 September 2018 (WIP/position papers only) ?Late submission? notification 30 September 2018 Workshop Date 04 November 2018 #### Format Instructions Please use the SIGPLAN acmart style for all papers: http://www.sigplan.org/Resources/Author/. The provided double-column template is available for Latex and Word. #### Program Committee Stephen Kell, University of Cambridge Stefan Marr, University of Kent Leif Andersen, Northeastern University Steve Blackburn, Australian National University Stephen Dolan, University of Cambridge Apala Guha, Simon Fraser University Christine H. Flood, Red Hat Roberto Ierusalimschy, PUC-Rio Tomas Kalibera, Czech Technical University Christos Kotselidis, The University of Manchester Doug Lea, State University of New York (SUNY) Oswego Sanhong Li, Alibaba Inc. Mark Marron, Microsoft Research Erez Petrank, Technion Julien Ponge, INSA Lyon, CITI Laboratory / Red Hat Richard Roberts, Victoria University of Wellington Jeremy Singer, University of Glasgow Sam Tobin-Hochstadt, Indiana University -- Stefan Marr School of Computing, University of Kent http://stefan-marr.de/research/ From ola.a.andersson@REDACTED Wed Jul 4 16:39:32 2018 From: ola.a.andersson@REDACTED (Ola Andersson A) Date: Wed, 4 Jul 2018 14:39:32 +0000 Subject: [erlang-questions] Idly wondering why this code in common test suite, init_per_suite/1 works In-Reply-To: <0F5401D3-B8E0-4C9F-A324-99AA10EA537F@gmail.com> References: <0F5401D3-B8E0-4C9F-A324-99AA10EA537F@gmail.com> Message-ID: Hi Bengt, I have a vague memory of that the process executing the init_per_suite function exits with another reason than normal. Don't know why though. This will terminate the gen_server. In the other example where the gen_server is started by a spawned process that exits with reason normal, it will be ignored by the gen_server. BR, /OLA. > -----Original Message----- > From: erlang-questions-bounces@REDACTED bounces@REDACTED> On Behalf Of bengt > Sent: den 3 juli 2018 20:52 > To: Erlang > Subject: [erlang-questions] Idly wondering why this code in common test > suite, init_per_suite/1 works > > Greetings, > > If somebody happens to know, otherwise ignore. I can read the source myself. > > 1) If I use start_link() from my test suites init_per_suite/1,then the gen_server > is dead in the test cases. > > 2) This made me either use gen_server:start(), or if the coding guidelines insist > upon placing the start_link() inside the gen_server callback module, the > following: > > init_per_suite(Config) -> > P = erlang:spawn( fun() -> > {ok, _} = mm:start_link(), > receive > end_per_suite -> ok > end > end ), > [{mm_pid, P} | Config]. > > In end_per_suite/1 I then send end_per_suite to Pid and the process exits. > Probably taking the gen_server with it. Unless it is trapping exists etc? But > this one is not. > > Today I forgot the receive statement . Like this: > > init_per_suite(Config) -> > P = erlang:spawn( fun() -> > {ok, _} = mm:start_link( ), > end ), > [{mm_pid, P}|Config]. > > And it still worked. Why? > Is this not the same thing when the spawned fun returns, as when > init_per_suite/1 returned without spawning (in 1)? > > > Surprised, > bengt > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From ilya.khaprov@REDACTED Fri Jul 6 13:12:19 2018 From: ilya.khaprov@REDACTED (Ilya Khaprov) Date: Fri, 6 Jul 2018 11:12:19 +0000 Subject: [erlang-questions] Can't login to JIRA with github account also ?bug? report Message-ID: Hello, Was trying to log in to bugs.erlang.org with my Github Account. All redirects went well and on the last page I saw this: "There was a problem during authentication.?Please refer to logs for an additional info." I see bugs.erlang.org in the authorized apps. What I wanted to report: if httpc:request called with binary header field value, request just hangs these silently. I blamed the server and then turned on tracing. Last record: (<0.81.0>) call httpc_manager:handle_info({'DOWN',#Ref<0.1185433242.2342256642.77265>,process,<0.1010.0>, ??????? {badarg,[{erlang,'++',[<<"Basic Og==">>,"\r\n"],[]}, ???????????????? {http_request,key_value_str,2, [{file,"http_request.erl"},{line,290}]}, ???????????????? {http_request,'-http_headers/1-fun-0-',3, [{file,"http_request.erl"},{line,64}]}, ???????????????? {lists,foldl,3,[{file,"lists.erl"},{line,1263}]}, ???????????????? {http_request,http_headers,1, [{file,"http_request.erl"},{line,63}]}, ???????????????? {httpc_request,send,4, [{file,"httpc_request.erl"},{line,103}]}, ???????????????? {httpc_handler,connect_and_send_first_request,3, [{file,"httpc_handler.erl"},{line,819}]}, ???????????????? {httpc_handler,init,1, [{file,"httpc_handler.erl"},{line,238}]}]}},{state,[],httpc_manager__handler_db, {cookie_db,undefined,#Ref<0.1185433242.2342387715.77591>}, ?????? httpc_manager__session_db,httpc_manager, ?????? {options,{undefined,[]}, ??????????????? {undefined,[]}, 0,2,5,120000,2,disabled,false,inet,default,default,[]}}) ({gen_server, try_dispatch, 4}) and request is still hanging. Erlang/OTP 20 [erts-9.2.1] I know that httpc client favors string, but I would say expecting no hang but that badarg bubbled to the top is reasonable. Thanks From DavidConrad@REDACTED Fri Jul 6 12:09:54 2018 From: DavidConrad@REDACTED (David Conrad) Date: Fri, 6 Jul 2018 06:09:54 -0400 Subject: [erlang-questions] Builds of 21.0.2? Message-ID: Greetings, I'm running OTP-20 on my Windows 10 machine. I see that 21 is out. But when I look in the download directory on the web site I see that there are binaries of 21.0 and 21.0.1, but READMEs of 21.0.1 and 21.0.2. Is there a build of 21.0.2 that is imminent which I should wait for, or should I just get 21.0.1? Do I need to build 21.0.2? (hope not) Thank you, David Conrad From fchschneider@REDACTED Fri Jul 6 13:34:40 2018 From: fchschneider@REDACTED (Frans Schneider) Date: Fri, 6 Jul 2018 13:34:40 +0200 Subject: [erlang-questions] Selecting records from Mnesia using partial key Message-ID: Dear list, Before trying to reinvent the wheel, maybe somebody can point me in the right direction. I have a request with a variable set of attributes [A, B, C...] and a Mnesia table with policies, each applicable for a also variable set of attributes [X, Y, Z...]. Policies may be applicable for the same set of attributes, in which case all these policies have to be evaluated. A policy should be selected if its attributes is the set _or a subset_ of attributes from the request: i.e. if the request has the set of attributes [A, B] than all policies with attributes [A, B], [A] and [B] should be selected. Attributes currently are records holding two strings but could be turned into atoms. Does anybody know a nice way to implement this in Mnesia? Thanks, Frans From ozgurfiratcinar@REDACTED Fri Jul 6 15:05:28 2018 From: ozgurfiratcinar@REDACTED (Ozgur Firat Cinar) Date: Fri, 6 Jul 2018 16:05:28 +0300 Subject: [erlang-questions] Can't login to JIRA with github account also ?bug? report In-Reply-To: References: Message-ID: Hi, >From the https://bugs.erlang.org/secure/Dashboard.jspa page, - Log in with an existing account. You can also log in with your Github account. *You need to have a publicly visible email on Github profile.* I think you don't have a publicly visible email on your GitHub profile. Have a nice day. Ozgur On Fri, Jul 6, 2018 at 2:12 PM Ilya Khaprov wrote: > Hello, > > Was trying to log in to bugs.erlang.org with my Github Account. All > redirects went well and on the last page I saw this: "There was a > problem during authentication. Please refer to logs for an additional > info." > > I see bugs.erlang.org in the authorized apps. > > > What I wanted to report: > > if httpc:request called with binary header field value, request just > hangs these silently. > I blamed the server and then turned on tracing. Last record: > > (<0.81.0>) call > httpc_manager:handle_info({'DOWN',#Ref<0.1185433242.2342256642 > <(234)%20225-6642>.77265>,process,<0.1010.0>, > {badarg,[{erlang,'++',[<<"Basic Og==">>,"\r\n"],[]}, > {http_request,key_value_str,2, > [{file,"http_request.erl"},{line,290}]}, > {http_request,'-http_headers/1-fun-0-',3, > [{file,"http_request.erl"},{line,64}]}, > {lists,foldl,3,[{file,"lists.erl"},{line,1263}]}, > {http_request,http_headers,1, > [{file,"http_request.erl"},{line,63}]}, > {httpc_request,send,4, > [{file,"httpc_request.erl"},{line,103}]}, > {httpc_handler,connect_and_send_first_request,3, > [{file,"httpc_handler.erl"},{line,819}]}, > {httpc_handler,init,1, > > [{file,"httpc_handler.erl"},{line,238}]}]}},{state,[],httpc_manager__handler_db, > {cookie_db,undefined,#Ref<0.1185433242.2342387715 <(234)%20238-7715> > .77591>}, > httpc_manager__session_db,httpc_manager, > {options,{undefined,[]}, > {undefined,[]}, > 0,2,5,120000,2,disabled,false,inet,default,default,[]}}) ({gen_server, > try_dispatch, > 4}) > > > and request is still hanging. > > Erlang/OTP 20 [erts-9.2.1] > > I know that httpc client favors string, but I would say expecting no > hang but that badarg bubbled to the top is reasonable. > > Thanks > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Ozgur Firat Cinar ---------------------------------------------------------------------------- E-mail: ozgurfiratcinar@REDACTED Web: http://www.hiorws.com Github: https://github.com/hiorws Twitter: https://www.twitter.com/hiorws -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Fri Jul 6 16:02:14 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Fri, 06 Jul 2018 23:02:14 +0900 Subject: [erlang-questions] Can't login to JIRA with github account also ?bug? report In-Reply-To: References: Message-ID: <2039722.fRpPE5BRh0@takoyaki> On 2018?7?6???? 11?12?19? JST Ilya Khaprov wrote: > Hello, > > Was trying to log in to bugs.erlang.org with my Github Account. All > redirects went well and on the last page I saw this: "There was a > problem during authentication. Please refer to logs for an additional > info." > > I see bugs.erlang.org in the authorized apps. Was wondering if someone would say "file a bug"... -Craig From sverker@REDACTED Fri Jul 6 16:10:36 2018 From: sverker@REDACTED (Sverker Eriksson) Date: Fri, 6 Jul 2018 16:10:36 +0200 Subject: [erlang-questions] Builds of 21.0.2? In-Reply-To: References: Message-ID: <1530886236.22646.4.camel@erlang.org> No, there is no Windows build for 21.0.2 forthcoming. We usually don't build Windows binaries for patch releases OTP-X.Y.* but OTP-21.0.1 was an exception to fix "The keys used in os:getenv and os:putenv are ?case-insensitive again on Windows." /Sverker, Erlang/OTP On fre, 2018-07-06 at 06:09 -0400, David Conrad wrote: > Greetings, > > I'm running OTP-20 on my Windows 10 machine. I see that 21 is out. > But when I look in the download directory on the web site I see that > there are binaries of 21.0 and 21.0.1, but READMEs of 21.0.1 and > 21.0.2. Is there a build of 21.0.2 that is imminent which I should wait > for, or should I just get 21.0.1? Do I need to build 21.0.2? (hope not) > > Thank you, > David Conrad > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From mark.geib.44@REDACTED Fri Jul 6 20:43:41 2018 From: mark.geib.44@REDACTED (Mark Geib) Date: Fri, 6 Jul 2018 12:43:41 -0600 Subject: [erlang-questions] r21 logger difficulties Message-ID: <41EE5540-D1D6-4C6E-9140-B4251C6988D9@gmail.com> I decided to take a look at the new logger in R21, but I am not able to produce any output. In my sys.config I have the following: {kernel, [{logger, [{handler, default, logger_std_h, #{level => debug, config => #{type => {file,"log/erlang.log"}}, formatter => {logger_formatter, #{template => [time," ",pid," ",msg,"\n"]}}} }] }] } And in my code I do something like logger:info(?test message?), but I never see any output to the file. I see the file log/erlang.log created, but always empty. I must be missing something, but I have read through the docs, quickly. Any pointers would be appreciated. Mark. -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 528 bytes Desc: Message signed with OpenPGP URL: From soverdor@REDACTED Sat Jul 7 01:48:15 2018 From: soverdor@REDACTED (Sam Overdorf) Date: Fri, 6 Jul 2018 16:48:15 -0700 Subject: [erlang-questions] erlang 21 Message-ID: Control-c does not get me out of the "erl" command line any more. Why not? Thanks, Sam Overdorf soverdor@REDACTED From luke@REDACTED Sat Jul 7 01:58:10 2018 From: luke@REDACTED (Luke Bakken) Date: Fri, 6 Jul 2018 16:58:10 -0700 Subject: [erlang-questions] erlang 21 In-Reply-To: References: Message-ID: Works on my Arch Linux workstation using a kerl-built Erlang 21.0.2 installation: $ erl Erlang/OTP 21 [erts-10.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [hipe] Eshell V10.0.2 (abort with ^G) 1> BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded (v)ersion (k)ill (D)b-tables (d)istribution ^C(21.0.2) I have to enter CTRL-C twice, but that's always been the case. What exactly happens in your environment? Are you on Linux, Windows, ...??? What terminal are you using? How did you build or install Erlang 21? That all seems like relevant information to provide. On Fri, Jul 6, 2018 at 4:48 PM, Sam Overdorf wrote: > Control-c does not get me out of the "erl" command line any more. > Why not? > > Thanks, > Sam Overdorf > soverdor@REDACTED > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From soverdor@REDACTED Sat Jul 7 02:05:39 2018 From: soverdor@REDACTED (Sam Overdorf) Date: Fri, 6 Jul 2018 17:05:39 -0700 Subject: [erlang-questions] erlang 21 In-Reply-To: References: Message-ID: It basicly ignors the key strokes ^c^c. I have to enter halt(). to get it to exit. Thanks Sam On Fri, Jul 6, 2018 at 4:58 PM, Luke Bakken wrote: > Works on my Arch Linux workstation using a kerl-built Erlang 21.0.2 > installation: > > $ erl > Erlang/OTP 21 [erts-10.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] > [async-threads:1] [hipe] > > Eshell V10.0.2 (abort with ^G) > 1> > BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded > (v)ersion (k)ill (D)b-tables (d)istribution > ^C(21.0.2) > > I have to enter CTRL-C twice, but that's always been the case. > > What exactly happens in your environment? Are you on Linux, Windows, > ...??? What terminal are you using? How did you build or install > Erlang 21? That all seems like relevant information to provide. > > On Fri, Jul 6, 2018 at 4:48 PM, Sam Overdorf wrote: >> Control-c does not get me out of the "erl" command line any more. >> Why not? >> >> Thanks, >> Sam Overdorf >> soverdor@REDACTED >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions From jose.valim@REDACTED Sat Jul 7 10:30:09 2018 From: jose.valim@REDACTED (=?UTF-8?Q?Jos=C3=A9_Valim?=) Date: Sat, 7 Jul 2018 10:30:09 +0200 Subject: [erlang-questions] erlang 21 In-Reply-To: References: Message-ID: Sam, which operating system are you using? How was "erl" started? Are you using any special terminal/shell? I have heard similar reports on Windows for Erlang/OTP 21. *Jos? Valim* www.plataformatec.com.br Skype: jv.ptec Founder and Director of R&D On Sat, Jul 7, 2018 at 2:05 AM, Sam Overdorf wrote: > It basicly ignors the key strokes ^c^c. > > I have to enter halt(). to get it to exit. > > Thanks > Sam > > > On Fri, Jul 6, 2018 at 4:58 PM, Luke Bakken wrote: > > Works on my Arch Linux workstation using a kerl-built Erlang 21.0.2 > > installation: > > > > $ erl > > Erlang/OTP 21 [erts-10.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] > > [async-threads:1] [hipe] > > > > Eshell V10.0.2 (abort with ^G) > > 1> > > BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded > > (v)ersion (k)ill (D)b-tables (d)istribution > > ^C(21.0.2) > > > > I have to enter CTRL-C twice, but that's always been the case. > > > > What exactly happens in your environment? Are you on Linux, Windows, > > ...??? What terminal are you using? How did you build or install > > Erlang 21? That all seems like relevant information to provide. > > > > On Fri, Jul 6, 2018 at 4:48 PM, Sam Overdorf wrote: > >> Control-c does not get me out of the "erl" command line any more. > >> Why not? > >> > >> Thanks, > >> Sam Overdorf > >> soverdor@REDACTED > >> _______________________________________________ > >> 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 alex@REDACTED Sat Jul 7 12:00:33 2018 From: alex@REDACTED (alex@REDACTED) Date: Sat, 7 Jul 2018 06:00:33 -0400 Subject: [erlang-questions] erlang 21 In-Reply-To: References: Message-ID: Hitting CTRL-C twice on Erlang 21.0.2 running Linux kernel 4.14.53 works fine.? Also, didn't encounter any issue with either using CTRL-C and then selecting "a" for abort, or halt(). or q().? Might be a particular issue with your system shell. Cheers, Alex On 07/07/2018 04:30 AM, Jos? Valim wrote: > Sam, which operating system are you using? How was "erl" started? Are > you using any special terminal/shell? > > I have heard similar reports on Windows for Erlang/OTP 21. > > > > > > *Jos? Valim* > www.plataformatec.com.br > Skype: jv.ptec > Founder and Director of R&D > > On Sat, Jul 7, 2018 at 2:05 AM, Sam Overdorf > wrote: > > It basicly ignors the key strokes ^c^c. > > I have to enter halt(). to get it to exit. > > Thanks > Sam > > > On Fri, Jul 6, 2018 at 4:58 PM, Luke Bakken > wrote: > > Works on my Arch Linux workstation using a kerl-built Erlang 21.0.2 > > installation: > > > > $ erl > > Erlang/OTP 21 [erts-10.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] > > [async-threads:1] [hipe] > > > > Eshell V10.0.2? (abort with ^G) > > 1> > > BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded > >? ? ? ? (v)ersion (k)ill (D)b-tables (d)istribution > > ^C(21.0.2) > > > > I have to enter CTRL-C twice, but that's always been the case. > > > > What exactly happens in your environment? Are you on Linux, Windows, > > ...??? What terminal are you using? How did you build or install > > Erlang 21? That all seems like relevant information to provide. > > > > On Fri, Jul 6, 2018 at 4:48 PM, Sam Overdorf > wrote: > >> Control-c does not get me out of the "erl" command line any more. > >> Why not? > >> > >> Thanks, > >> Sam Overdorf > >> soverdor@REDACTED > >> _______________________________________________ > >> 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Sat Jul 7 12:59:30 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Sat, 07 Jul 2018 19:59:30 +0900 Subject: [erlang-questions] erlang 21 In-Reply-To: References: Message-ID: <41381298.9HviYJOSeE@takoyaki> A quick anecdote... I and a lot of people on my team used to habitually halt() to exit. Then one day someone abruptly shut down a remote node they were connected to because, well, they had that habit. ^G is a safer habit to form and reminds you where you are at when you hit it, whether connected to a remote node from a local erl shell (want 'q'), or via SSH (want 'exit()'). -Craig From dmytro.lytovchenko@REDACTED Sat Jul 7 13:03:04 2018 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Sat, 7 Jul 2018 13:03:04 +0200 Subject: [erlang-questions] erlang 21 In-Reply-To: <41381298.9HviYJOSeE@takoyaki> References: <41381298.9HviYJOSeE@takoyaki> Message-ID: I would say there is a clear usability flaw here. The shell should be smart enough to distinguish which command was typed (^G, ^C or q() or exit() or init:stop() or halt()) and whether there is a remote shell active. What it would do is to ask user what is his intent or somehow confirm that remote shell is active and REMOTE VM will now quit. If the shell isn't that smart, there's a great improvement waiting to happen. 2018-07-07 12:59 GMT+02:00 : > A quick anecdote... > > I and a lot of people on my team used to habitually halt() to exit. > > Then one day someone abruptly shut down a remote node they were connected > to because, well, they had that habit. > > ^G is a safer habit to form and reminds you where you are at when you hit > it, whether connected to a remote node from a local erl shell (want 'q'), > or via SSH (want 'exit()'). > > -Craig > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Sat Jul 7 13:12:58 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Sat, 07 Jul 2018 20:12:58 +0900 Subject: [erlang-questions] erlang 21 In-Reply-To: References: <41381298.9HviYJOSeE@takoyaki> Message-ID: <6031379.s24TQAze0r@takoyaki> Those usability improvements have already been made: ^G Gets you to JCL mode. All Erlangers should be familiar with this. If you're not, then read up on it and play around. Not much to learn. restricted shell This is the real life saver: picking what commands are allowed to be run by a user. This gives you a LOT more flexibility and than merely making things like q() and exit() more special than they already are. customized shell over SSH Even more freedom than a restricted shell definition. You can write some really awesome remote tools this way (or an entire MUD interface...). halt() and init:stop() are system calls and really shouldn't be the subject of any human's habit-forming behaviors. IMO this is a case of the humans ignoring the tools that have been made available -- making similar things available under different names is not likely to help. -Craig On 2018?7?7???? 13?03?04? JST you wrote: > I would say there is a clear usability flaw here. The shell should be smart > enough to distinguish which command was typed (^G, ^C or q() or exit() or > init:stop() or halt()) and whether there is a remote shell active. What it > would do is to ask user what is his intent or somehow confirm that remote > shell is active and REMOTE VM will now quit. > > If the shell isn't that smart, there's a great improvement waiting to > happen. > > 2018-07-07 12:59 GMT+02:00 : > > > A quick anecdote... > > > > I and a lot of people on my team used to habitually halt() to exit. > > > > Then one day someone abruptly shut down a remote node they were connected > > to because, well, they had that habit. > > > > ^G is a safer habit to form and reminds you where you are at when you hit > > it, whether connected to a remote node from a local erl shell (want 'q'), > > or via SSH (want 'exit()'). > > > > -Craig > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > From zxq9@REDACTED Sat Jul 7 13:21:30 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Sat, 07 Jul 2018 20:21:30 +0900 Subject: [erlang-questions] erlang 21 In-Reply-To: <6031379.s24TQAze0r@takoyaki> References: <6031379.s24TQAze0r@takoyaki> Message-ID: <1828716.Od0eDlTA4O@takoyaki> On 2018?7?7???? 20?12?58? JST zxq9@REDACTED wrote: > Those usability improvements have already been made: > > ^G > Gets you to JCL mode. All Erlangers should be familiar with this. If you're > not, then read up on it and play around. Not much to learn. > > restricted shell > This is the real life saver: picking what commands are allowed to be run by > a user. This gives you a LOT more flexibility and than merely making things > like q() and exit() more special than they already are. > > customized shell over SSH > Even more freedom than a restricted shell definition. You can write some > really awesome remote tools this way (or an entire MUD interface...). > > > halt() and init:stop() are system calls and really shouldn't be the subject > of any human's habit-forming behaviors. > > IMO this is a case of the humans ignoring the tools that have been made > available -- making similar things available under different names is not > likely to help. I hate to be the guy to sound preachy without providing a solution, so here are links to the relevant parts of the docs for those who aren't sure where to look to find all the magic. (I remember the docs being a bit daunting when I returned to Erlang...) Here are some useful spots to read up on and bookmark. Even if you don't make much use of this stuff any time soon, knowing it is available tends to lead to better results. Erlang shell docs: http://erlang.org/doc/man/shell.html Shell docs section on JCL mode (you should be familiar with this): http://erlang.org/doc/man/shell.html#jcl-mode Section on restricted mode: http://erlang.org/doc/man/shell.html#restricted-shell The coolest thing ever -- defining your own shell commands and behavior: http://erlang.org/doc/man/shell_default.html SSH app (amazing things can be done with this): http://erlang.org/doc/man/SSH_app.html -Craig From fly@REDACTED Sat Jul 7 14:28:44 2018 From: fly@REDACTED (Fred Youhanaie) Date: Sat, 7 Jul 2018 13:28:44 +0100 Subject: [erlang-questions] erlang 21 In-Reply-To: <6031379.s24TQAze0r@takoyaki> References: <41381298.9HviYJOSeE@takoyaki> <6031379.s24TQAze0r@takoyaki> Message-ID: I'll just add to all the good advice so far that "erl +Bi" will disable Ctrl-C. That might be the source of Sam's issue. Cheers, Fred On 07/07/18 12:12, zxq9@REDACTED wrote: > Those usability improvements have already been made: > > ^G > Gets you to JCL mode. All Erlangers should be familiar with this. If you're > not, then read up on it and play around. Not much to learn. > > restricted shell > This is the real life saver: picking what commands are allowed to be run by > a user. This gives you a LOT more flexibility and than merely making things > like q() and exit() more special than they already are. > > customized shell over SSH > Even more freedom than a restricted shell definition. You can write some > really awesome remote tools this way (or an entire MUD interface...). > > > halt() and init:stop() are system calls and really shouldn't be the subject > of any human's habit-forming behaviors. > > IMO this is a case of the humans ignoring the tools that have been made > available -- making similar things available under different names is not > likely to help. > > -Craig > > > On 2018?7?7???? 13?03?04? JST you wrote: >> I would say there is a clear usability flaw here. The shell should be smart >> enough to distinguish which command was typed (^G, ^C or q() or exit() or >> init:stop() or halt()) and whether there is a remote shell active. What it >> would do is to ask user what is his intent or somehow confirm that remote >> shell is active and REMOTE VM will now quit. >> >> If the shell isn't that smart, there's a great improvement waiting to >> happen. >> >> 2018-07-07 12:59 GMT+02:00 : >> >>> A quick anecdote... >>> >>> I and a lot of people on my team used to habitually halt() to exit. >>> >>> Then one day someone abruptly shut down a remote node they were connected >>> to because, well, they had that habit. >>> >>> ^G is a safer habit to form and reminds you where you are at when you hit >>> it, whether connected to a remote node from a local erl shell (want 'q'), >>> or via SSH (want 'exit()'). >>> >>> -Craig >>> _______________________________________________ >>> 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 soverdor@REDACTED Sat Jul 7 23:18:37 2018 From: soverdor@REDACTED (Sam Overdorf) Date: Sat, 7 Jul 2018 14:18:37 -0700 Subject: [erlang-questions] erlang 21 In-Reply-To: References: <41381298.9HviYJOSeE@takoyaki> <6031379.s24TQAze0r@takoyaki> Message-ID: I'm running windows 7 professional. It works fine with otp-20 and older versions (I still use 20.3) so something has been changed.. if I run "erl +Bc" then control-c works just fine. Is there a configuration file for :"erl" that I can add this flag to to make it work the old way? I use control-c all of the time. Thanks, Sam On Sat, Jul 7, 2018 at 5:28 AM, Fred Youhanaie wrote: > I'll just add to all the good advice so far that "erl +Bi" will disable > Ctrl-C. > > That might be the source of Sam's issue. > > Cheers, > Fred > > > On 07/07/18 12:12, zxq9@REDACTED wrote: >> >> Those usability improvements have already been made: >> >> ^G >> Gets you to JCL mode. All Erlangers should be familiar with this. If >> you're >> not, then read up on it and play around. Not much to learn. >> >> restricted shell >> This is the real life saver: picking what commands are allowed to be run >> by >> a user. This gives you a LOT more flexibility and than merely making >> things >> like q() and exit() more special than they already are. >> >> customized shell over SSH >> Even more freedom than a restricted shell definition. You can write some >> really awesome remote tools this way (or an entire MUD interface...). >> >> halt() and init:stop() are system calls and really shouldn't be the >> subject >> of any human's habit-forming behaviors. >> >> IMO this is a case of the humans ignoring the tools that have been made >> available -- making similar things available under different names is not >> likely to help. >> >> -Craig >> >> >> On 2018?7?7???? 13?03?04? JST you wrote: >>> >>> I would say there is a clear usability flaw here. The shell should be >>> smart >>> enough to distinguish which command was typed (^G, ^C or q() or exit() or >>> init:stop() or halt()) and whether there is a remote shell active. What >>> it >>> would do is to ask user what is his intent or somehow confirm that remote >>> shell is active and REMOTE VM will now quit. >>> >>> If the shell isn't that smart, there's a great improvement waiting to >>> happen. >>> >>> 2018-07-07 12:59 GMT+02:00 : >>> >>>> A quick anecdote... >>>> >>>> I and a lot of people on my team used to habitually halt() to exit. >>>> >>>> Then one day someone abruptly shut down a remote node they were >>>> connected >>>> to because, well, they had that habit. >>>> >>>> ^G is a safer habit to form and reminds you where you are at when you >>>> hit >>>> it, whether connected to a remote node from a local erl shell (want >>>> 'q'), >>>> or via SSH (want 'exit()'). >>>> >>>> -Craig >>>> _______________________________________________ >>>> 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 From fly@REDACTED Sun Jul 8 14:47:23 2018 From: fly@REDACTED (Fred Youhanaie) Date: Sun, 8 Jul 2018 13:47:23 +0100 Subject: [erlang-questions] erlang 21 In-Reply-To: References: <41381298.9HviYJOSeE@takoyaki> <6031379.s24TQAze0r@takoyaki> Message-ID: <1f4c842b-f1e9-c753-4036-5ca4c4a739f6@anydata.co.uk> I don't have windows installation, so can't comment on that side. However, the man page for erl says: "Notice also that Ctrl-Break is used instead of Ctrl-C on Windows." Does Ctrl-Break work for you? Cheers, Fred On 07/07/18 22:18, Sam Overdorf wrote: > I'm running windows 7 professional. > > It works fine with otp-20 and older versions (I still use 20.3) so > something has been changed.. > if I run "erl +Bc" then control-c works just fine. > Is there a configuration file for :"erl" that I can add this flag to > to make it work the old way? > I use control-c all of the time. > > Thanks, > Sam > > On Sat, Jul 7, 2018 at 5:28 AM, Fred Youhanaie wrote: >> I'll just add to all the good advice so far that "erl +Bi" will disable >> Ctrl-C. >> >> That might be the source of Sam's issue. >> >> Cheers, >> Fred >> >> >> On 07/07/18 12:12, zxq9@REDACTED wrote: >>> >>> Those usability improvements have already been made: >>> >>> ^G >>> Gets you to JCL mode. All Erlangers should be familiar with this. If >>> you're >>> not, then read up on it and play around. Not much to learn. >>> >>> restricted shell >>> This is the real life saver: picking what commands are allowed to be run >>> by >>> a user. This gives you a LOT more flexibility and than merely making >>> things >>> like q() and exit() more special than they already are. >>> >>> customized shell over SSH >>> Even more freedom than a restricted shell definition. You can write some >>> really awesome remote tools this way (or an entire MUD interface...). >>> >>> halt() and init:stop() are system calls and really shouldn't be the >>> subject >>> of any human's habit-forming behaviors. >>> >>> IMO this is a case of the humans ignoring the tools that have been made >>> available -- making similar things available under different names is not >>> likely to help. >>> >>> -Craig >>> >>> >>> On 2018?7?7???? 13?03?04? JST you wrote: >>>> >>>> I would say there is a clear usability flaw here. The shell should be >>>> smart >>>> enough to distinguish which command was typed (^G, ^C or q() or exit() or >>>> init:stop() or halt()) and whether there is a remote shell active. What >>>> it >>>> would do is to ask user what is his intent or somehow confirm that remote >>>> shell is active and REMOTE VM will now quit. >>>> >>>> If the shell isn't that smart, there's a great improvement waiting to >>>> happen. >>>> >>>> 2018-07-07 12:59 GMT+02:00 : >>>> >>>>> A quick anecdote... >>>>> >>>>> I and a lot of people on my team used to habitually halt() to exit. >>>>> >>>>> Then one day someone abruptly shut down a remote node they were >>>>> connected >>>>> to because, well, they had that habit. >>>>> >>>>> ^G is a safer habit to form and reminds you where you are at when you >>>>> hit >>>>> it, whether connected to a remote node from a local erl shell (want >>>>> 'q'), >>>>> or via SSH (want 'exit()'). >>>>> >>>>> -Craig >>>>> _______________________________________________ >>>>> 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 > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From mikpelinux@REDACTED Sun Jul 8 16:45:59 2018 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Sun, 8 Jul 2018 16:45:59 +0200 Subject: [erlang-questions] Selecting records from Mnesia using partial key In-Reply-To: References: Message-ID: On Fri, Jul 6, 2018 at 1:34 PM, Frans Schneider wrote: > Dear list, > > Before trying to reinvent the wheel, maybe somebody can point me in the > right direction. > > I have a request with a variable set of attributes [A, B, C...] and a Mnesia > table with policies, each applicable for a also variable set of attributes > [X, Y, Z...]. Policies may be applicable for the same set of attributes, in > which case all these policies have to be evaluated. > > A policy should be selected if its attributes is the set _or a subset_ of > attributes from the request: i.e. if the request has the set of attributes > [A, B] than all policies with attributes [A, B], [A] and [B] should be > selected. > > Attributes currently are records holding two strings but could be turned > into atoms. > > Does anybody know a nice way to implement this in Mnesia? Without further information about or restrictions to your problem, I guess the simplest solution is to use a qlc to query the policies table, and in the qlc filter by available attributes. This is effectively going to traverse the entire table, so it won't be very efficient, but it may be enough for your case (we don't know your table size, number of attributes, etc). If you want something more efficient, you'll need one or more indices, i.e. mappings from attributes (or sets of attributes) to applicable policies. Since your input may contain a superset of a policy's attributes, you'll have to create it/them yourself rather than relying on mnesia's built-in indexing support. From soverdor@REDACTED Mon Jul 9 00:26:48 2018 From: soverdor@REDACTED (Sam Overdorf) Date: Sun, 8 Jul 2018 15:26:48 -0700 Subject: [erlang-questions] erlang 21 In-Reply-To: <1f4c842b-f1e9-c753-4036-5ca4c4a739f6@anydata.co.uk> References: <41381298.9HviYJOSeE@takoyaki> <6031379.s24TQAze0r@takoyaki> <1f4c842b-f1e9-c753-4036-5ca4c4a739f6@anydata.co.uk> Message-ID: My laptop does not have the proverbial Break-key (not enough room for it). I don't remember if the alt-ctl-b is the same thing. If I knew where the app-config-file is for erl I can change that to get it working. Thanks, Sam On Sun, Jul 8, 2018 at 5:47 AM, Fred Youhanaie wrote: > I don't have windows installation, so can't comment on that side. > > However, the man page for erl says: > > "Notice also that Ctrl-Break is used instead of Ctrl-C on Windows." > > Does Ctrl-Break work for you? > > Cheers, > Fred > > > On 07/07/18 22:18, Sam Overdorf wrote: >> >> I'm running windows 7 professional. >> >> It works fine with otp-20 and older versions (I still use 20.3) so >> something has been changed.. >> if I run "erl +Bc" then control-c works just fine. >> Is there a configuration file for :"erl" that I can add this flag to >> to make it work the old way? >> I use control-c all of the time. >> >> Thanks, >> Sam >> >> On Sat, Jul 7, 2018 at 5:28 AM, Fred Youhanaie wrote: >>> >>> I'll just add to all the good advice so far that "erl +Bi" will disable >>> Ctrl-C. >>> >>> That might be the source of Sam's issue. >>> >>> Cheers, >>> Fred >>> >>> >>> On 07/07/18 12:12, zxq9@REDACTED wrote: >>>> >>>> >>>> Those usability improvements have already been made: >>>> >>>> ^G >>>> Gets you to JCL mode. All Erlangers should be familiar with this. If >>>> you're >>>> not, then read up on it and play around. Not much to learn. >>>> >>>> restricted shell >>>> This is the real life saver: picking what commands are allowed to be run >>>> by >>>> a user. This gives you a LOT more flexibility and than merely making >>>> things >>>> like q() and exit() more special than they already are. >>>> >>>> customized shell over SSH >>>> Even more freedom than a restricted shell definition. You can write some >>>> really awesome remote tools this way (or an entire MUD interface...). >>>> >>>> halt() and init:stop() are system calls and really shouldn't be the >>>> subject >>>> of any human's habit-forming behaviors. >>>> >>>> IMO this is a case of the humans ignoring the tools that have been made >>>> available -- making similar things available under different names is >>>> not >>>> likely to help. >>>> >>>> -Craig >>>> >>>> >>>> On 2018?7?7???? 13?03?04? JST you wrote: >>>>> >>>>> >>>>> I would say there is a clear usability flaw here. The shell should be >>>>> smart >>>>> enough to distinguish which command was typed (^G, ^C or q() or exit() >>>>> or >>>>> init:stop() or halt()) and whether there is a remote shell active. What >>>>> it >>>>> would do is to ask user what is his intent or somehow confirm that >>>>> remote >>>>> shell is active and REMOTE VM will now quit. >>>>> >>>>> If the shell isn't that smart, there's a great improvement waiting to >>>>> happen. >>>>> >>>>> 2018-07-07 12:59 GMT+02:00 : >>>>> >>>>>> A quick anecdote... >>>>>> >>>>>> I and a lot of people on my team used to habitually halt() to exit. >>>>>> >>>>>> Then one day someone abruptly shut down a remote node they were >>>>>> connected >>>>>> to because, well, they had that habit. >>>>>> >>>>>> ^G is a safer habit to form and reminds you where you are at when you >>>>>> hit >>>>>> it, whether connected to a remote node from a local erl shell (want >>>>>> 'q'), >>>>>> or via SSH (want 'exit()'). >>>>>> >>>>>> -Craig >>>>>> _______________________________________________ >>>>>> 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 >> >> _______________________________________________ >> 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 erlangsiri@REDACTED Mon Jul 9 09:33:19 2018 From: erlangsiri@REDACTED (Siri Hansen) Date: Mon, 9 Jul 2018 09:33:19 +0200 Subject: [erlang-questions] r21 logger difficulties In-Reply-To: <41EE5540-D1D6-4C6E-9140-B4251C6988D9@gmail.com> References: <41EE5540-D1D6-4C6E-9140-B4251C6988D9@gmail.com> Message-ID: Hi Mark, you just missed that the primary log level by default is 'notice', which means that 'info' is rejected by the primary log level check. If you do logger:notice("test message") instead, it should be printed. To even print 'info', set the kernel configuration parameter logger_level to 'info', 'debug' or 'all' in your sys config, or set it in runtime with logger:set_primary_config(level,Level). Regards /siri Den fre. 6. jul. 2018 kl. 20:44 skrev Mark Geib : > I decided to take a look at the new logger in R21, but I am not able to > produce any output. > > In my sys.config I have the following: > {kernel, > [{logger, > [{handler, default, logger_std_h, > #{level => debug, > config => #{type => {file,"log/erlang.log"}}, > formatter => {logger_formatter, #{template => [time," ",pid," > ",msg,"\n"]}}} > }] > }] > } > > And in my code I do something like logger:info(?test message?), but I > never see any output to the file. I see the file log/erlang.log created, > but always empty. > > I must be missing something, but I have read through the docs, quickly. > > Any pointers would be appreciated. > > Mark. > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From fchschneider@REDACTED Mon Jul 9 09:44:14 2018 From: fchschneider@REDACTED (Frans Schneider) Date: Mon, 9 Jul 2018 09:44:14 +0200 Subject: [erlang-questions] Selecting records from Mnesia using partial key In-Reply-To: References: Message-ID: Yes, I know I had to be more specific, but this was one of those Friday afternoon posts looking for an easy answer. The thing is, looking for applicable policies all combinations of attributes from the request have to be tried: i.e. the number of combinations becomes an issue. Fetching policies from Mnesia based on their attributes is trivial using hashing. The number of policies in the Mnesia table may be up to 10K, maybe 100K. The number of attributes per request, as far as I have seen, varies mostly between 4 and 8. The repository has a primary key for the policy id and a index key which is the hash of the attribute ids used by that policy. The number of requests is high, as high as possible, and come from applications making authorization calls. For horizontal scaling, the repository should be distributed. Looking up policies probably should be implemented using some digraph type of structure on top of some storage back-end, maybe a graph database. I have seen some implementations of that but all lack the possibility to remove or make changes to policies after the graph has been created without rebuilding the whole graph. With the regular changes made to authorizations, making changes to the graph is mandatory. Maybe somebody did something before like this and I would like some input. Frans [1] On 07/08/2018 04:45 PM, Mikael Pettersson wrote: > On Fri, Jul 6, 2018 at 1:34 PM, Frans Schneider wrote: >> Dear list, >> >> Before trying to reinvent the wheel, maybe somebody can point me in the >> right direction. >> >> I have a request with a variable set of attributes [A, B, C...] and a Mnesia >> table with policies, each applicable for a also variable set of attributes >> [X, Y, Z...]. Policies may be applicable for the same set of attributes, in >> which case all these policies have to be evaluated. >> >> A policy should be selected if its attributes is the set _or a subset_ of >> attributes from the request: i.e. if the request has the set of attributes >> [A, B] than all policies with attributes [A, B], [A] and [B] should be >> selected. >> >> Attributes currently are records holding two strings but could be turned >> into atoms. >> >> Does anybody know a nice way to implement this in Mnesia? > > Without further information about or restrictions to your problem, I guess the > simplest solution is to use a qlc to query the policies table, and in the qlc > filter by available attributes. > > This is effectively going to traverse the entire table, so it won't be > very efficient, > but it may be enough for your case (we don't know your table size, number of > attributes, etc). > > If you want something more efficient, you'll need one or more indices, i.e. > mappings from attributes (or sets of attributes) to applicable policies. Since > your input may contain a superset of a policy's attributes, you'll have to > create it/them yourself rather than relying on mnesia's built-in > indexing support. > From Catenacci@REDACTED Mon Jul 9 15:04:15 2018 From: Catenacci@REDACTED (Onorio Catenacci) Date: Mon, 9 Jul 2018 09:04:15 -0400 Subject: [erlang-questions] Ctrl+C And Windows (was Erlang 21) In-Reply-To: References: Message-ID: Hi all, Fred: the fact that Ctrl+C was working for him prior to installing Erlang 21 seems to argue against him needing to use Ctrl+Break instead. Sam: For whatever it's worth, the Ctrl+C on Erlang 21 works just fine for me on Windows 10. So this does seem to have something to do with Windows 7 and Erlang 21. I'd suggest you file a bug. All: please snip the prior digest when you reply. It can be sort of difficult to find the relevant text when one needs to wade through the entire previous day's digest. -- Onorio Catenacci http://onor.io http://www.google.com/+OnorioCatenacci -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.geib.44@REDACTED Mon Jul 9 16:51:54 2018 From: mark.geib.44@REDACTED (Mark Geib) Date: Mon, 9 Jul 2018 08:51:54 -0600 Subject: [erlang-questions] r21 logger difficulties In-Reply-To: References: <41EE5540-D1D6-4C6E-9140-B4251C6988D9@gmail.com> Message-ID: Thanks Siri, But in my sys.config I included the log level, and I was trying to set it to ?debug?. I just now changed the level to ?all? but still nothing in the log file. BTW, if I force a crash due to runtime error I do see the crash reports in the log file, but that is all. Also, lager is being pulled in by a dependency, could there be a conflict with lager.?? Thanks, Mark. > On Jul 9, 2018, at 1:33 AM, Siri Hansen wrote: > > Hi Mark, you just missed that the primary log level by default is 'notice', which means that 'info' is rejected by the primary log level check. If you do logger:notice("test message") instead, it should be printed. To even print 'info', set the kernel configuration parameter logger_level to 'info', 'debug' or 'all' in your sys config, or set it in runtime with logger:set_primary_config(level,Level). > > Regards > /siri > > Den fre. 6. jul. 2018 kl. 20:44 skrev Mark Geib >: > I decided to take a look at the new logger in R21, but I am not able to produce any output. > > In my sys.config I have the following: > {kernel, > [{logger, > [{handler, default, logger_std_h, > #{level => debug, > config => #{type => {file,"log/erlang.log"}}, > formatter => {logger_formatter, #{template => [time," ",pid," ",msg,"\n"]}}} > }] > }] > } > > And in my code I do something like logger:info(?test message?), but I never see any output to the file. I see the file log/erlang.log created, but always empty. > > I must be missing something, but I have read through the docs, quickly. > > Any pointers would be appreciated. > > Mark. > _______________________________________________ > 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: 528 bytes Desc: Message signed with OpenPGP URL: From yevhenii.kurtov@REDACTED Mon Jul 9 16:33:20 2018 From: yevhenii.kurtov@REDACTED (Yevhenii Kurtov) Date: Mon, 9 Jul 2018 21:33:20 +0700 Subject: [erlang-questions] Running a fleet of OS processes Message-ID: Hi, I'm in a situation where most straightforward way to solve the task would be to run a 3rd party binary per each active user. Each of those binaries speaks to the outside world and maintains their own state which is of great importance for the system. Without them user is basically blocked locked. The scope of the task is to: - start 3rd party program for all users during application launch - start 3rd party program on the go for new users - continiously poll their state (JSON RPC API) and report updated state if it changed since last poll - restart individual apps when they crash Idea is to start as many apps as node can carry on and I'm not sure what is the best way to tame this beast. I'm surely will use Erlexec and probably will create a gen_server that will keep a list of the processes in its state. Then there will be a pool of workers that will go and poll a fleet once in a while. That's kinda basic scenario that I can think of, but maybe there are people who had similar problems and can suggest a better approach or advice on how to avoid bottlenecks. Apart from solving the architecture there is a resource monitoring problem to not overload the node. The memory utilization is not an issue, but I/O is. I wonder what would a right marker to stop spawning new processes? Logically I should somehow measure I/O utilization during poll and act accordingly. With large enough pool of processes poll should be going all the time :) That's basically it. Any input is appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From mark.geib.44@REDACTED Mon Jul 9 19:22:14 2018 From: mark.geib.44@REDACTED (Mark Geib) Date: Mon, 9 Jul 2018 11:22:14 -0600 Subject: [erlang-questions] r21 logger difficulties In-Reply-To: References: <41EE5540-D1D6-4C6E-9140-B4251C6988D9@gmail.com> Message-ID: <5983CF5F-3E08-4CF2-BEC3-B5EF15F95CCA@gmail.com> So after some more debugging, it appears that if I use ?debug? or ?info? in either the sys.config logger config for the logging level, or as the level of log message I see nothing. If I use any of the other levels it appears to work as expected. All the combinations I tried worked as well, i.e. if I set the log level in the config to ?notice? and then log with logger:emergency(), it works fine. Mark. > On Jul 9, 2018, at 1:33 AM, Siri Hansen wrote: > > Hi Mark, you just missed that the primary log level by default is 'notice', which means that 'info' is rejected by the primary log level check. If you do logger:notice("test message") instead, it should be printed. To even print 'info', set the kernel configuration parameter logger_level to 'info', 'debug' or 'all' in your sys config, or set it in runtime with logger:set_primary_config(level,Level). > > Regards > /siri > > Den fre. 6. jul. 2018 kl. 20:44 skrev Mark Geib >: > I decided to take a look at the new logger in R21, but I am not able to produce any output. > > In my sys.config I have the following: > {kernel, > [{logger, > [{handler, default, logger_std_h, > #{level => debug, > config => #{type => {file,"log/erlang.log"}}, > formatter => {logger_formatter, #{template => [time," ",pid," ",msg,"\n"]}}} > }] > }] > } > > And in my code I do something like logger:info(?test message?), but I never see any output to the file. I see the file log/erlang.log created, but always empty. > > I must be missing something, but I have read through the docs, quickly. > > Any pointers would be appreciated. > > Mark. > _______________________________________________ > 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: 528 bytes Desc: Message signed with OpenPGP URL: From codewiget95@REDACTED Mon Jul 9 20:57:20 2018 From: codewiget95@REDACTED (Code Wiget) Date: Mon, 9 Jul 2018 14:57:20 -0400 Subject: [erlang-questions] Including function in configuration file Message-ID: <97239fa3-1e1c-4f6d-899f-f759b7e2964c@Spark> Hi, Say I want to include a function as an environment variable I can do this: ?application:set_env(App, Key, NewValue). Is there any way to do this from a .config file? Such as: ?[{my_app, [ {my_fun, #Fun}]}] ? this gives a compile error. -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Mon Jul 9 21:15:44 2018 From: roger@REDACTED (Roger Lipscombe) Date: Mon, 9 Jul 2018 20:15:44 +0100 Subject: [erlang-questions] Including function in configuration file In-Reply-To: <97239fa3-1e1c-4f6d-899f-f759b7e2964c@Spark> References: <97239fa3-1e1c-4f6d-899f-f759b7e2964c@Spark> Message-ID: No. The '#Fun' isn't really a thing; it's just how the function is printed in the shell. If you want to reference a function in a config file, it needs to be a real function, and you need to reference it by name. If you don't know which module it's implemented in, you'll need to specify that in your config file as well. Something like this: [ {my_app, [ {my_magic_func, {the_module, func_name}} ]} ]. Then, in your code that reads the configuration value, you need to explicitly invoke the function with erlang:apply... {ok, {Module, Func}} = application:get_env(my_app, my_magic_func), erlang:apply(Module, Func, [Arg1, Arg2]) % calls the_module:func_name(Arg1, Arg2) On 9 July 2018 at 19:57, Code Wiget wrote: > Hi, > > Say I want to include a function as an environment variable > > I can do this: > ?application:set_env(App, Key, NewValue). > > Is there any way to do this from a .config file? Such as: > ?[{my_app, [ {my_fun, #Fun}]}] > > ? this gives a compile error. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From codewiget95@REDACTED Mon Jul 9 21:16:56 2018 From: codewiget95@REDACTED (Code Wiget) Date: Mon, 9 Jul 2018 15:16:56 -0400 Subject: [erlang-questions] Including function in configuration file In-Reply-To: References: <97239fa3-1e1c-4f6d-899f-f759b7e2964c@Spark> Message-ID: So, for the ssl options such as: {reuse_session, fun()} {next_protocols_advertised, [binary()]} {user_lookup_fun, {fun(), term()}}, {psk_identity, string()}, {srp_identity, {string(), string()}} You have to manually set the configuration parameters, and cannot set them in a configuration file? On Jul 9, 2018, 3:15 PM -0400, Roger Lipscombe , wrote: > No. The '#Fun' isn't really a thing; it's just how the function > is printed in the shell. > > If you want to reference a function in a config file, it needs to be a > real function, and you need to reference it by name. If you don't know > which module it's implemented in, you'll need to specify that in your > config file as well. Something like this: > > [ > {my_app, > [ > {my_magic_func, {the_module, func_name}} > ]} > ]. > > Then, in your code that reads the configuration value, you need to > explicitly invoke the function with erlang:apply... > > {ok, {Module, Func}} = application:get_env(my_app, my_magic_func), > erlang:apply(Module, Func, [Arg1, Arg2]) % calls > the_module:func_name(Arg1, Arg2) > > > > On 9 July 2018 at 19:57, Code Wiget wrote: > > Hi, > > > > Say I want to include a function as an environment variable > > > > I can do this: > > ?application:set_env(App, Key, NewValue). > > > > Is there any way to do this from a .config file? Such as: > > ?[{my_app, [ {my_fun, #Fun}]}] > > > > ? this gives a compile error. > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mjtruog@REDACTED Mon Jul 9 21:34:44 2018 From: mjtruog@REDACTED (Michael Truog) Date: Mon, 9 Jul 2018 12:34:44 -0700 Subject: [erlang-questions] Including function in configuration file In-Reply-To: References: <97239fa3-1e1c-4f6d-899f-f759b7e2964c@Spark> Message-ID: On 07/09/2018 12:16 PM, Code Wiget wrote: > So, for the ssl options such as: > {reuse_session, fun()} {next_protocols_advertised, [binary()]} > > {user_lookup_fun, {fun(), term()}}, {psk_identity, string()}, {srp_identity, {string(), string()}} > > You have to manually set the configuration parameters, and cannot set them in a configuration file? I use {Module :: atom(), Function :: atom()} to represent a function for configuration because the arity can be inferred from the configuration value.? I also use {{Module :: atom(), Function :: atom()}} to allow an arity 0 function to return a function, to allow a closure to be used.? The source code I use for this is at https://github.com/CloudI/CloudI/blob/95e76d30ff655562682132f9ec04b07075ce055d/src/lib/cloudi_core/src/cloudi_args_type.erl#L53-L136 Best Regards, Michael -------------- next part -------------- An HTML attachment was scrubbed... URL: From roger@REDACTED Mon Jul 9 21:50:14 2018 From: roger@REDACTED (Roger Lipscombe) Date: Mon, 9 Jul 2018 20:50:14 +0100 Subject: [erlang-questions] Including function in configuration file In-Reply-To: References: <97239fa3-1e1c-4f6d-899f-f759b7e2964c@Spark> Message-ID: On 9 July 2018 at 20:16, Code Wiget wrote: > So, for the ssl options such as: > {reuse_session, fun()} {next_protocols_advertised, [binary()]} > > {user_lookup_fun, {fun(), term()}}, {psk_identity, string()}, {srp_identity, > {string(), string()}} > > You have to manually set the configuration parameters, and cannot set them > in a configuration file? Yes, but you _can_ come up with some other way to specify them in the configuration file, and then convert that to an actual function before you pass it to SSL options. We have something like this in our code: convert_ssl_opt({verify_opts, VerifyOpts}, Acc) -> Opt = {verify_fun, {fun do_verify/3, VerifyOpts}}, [Opt | Acc]; ...which converts our invented 'verify_opts' into the required 'verify_fun', by using a do_verify function in the module that does the conversion. From oliver.korpilla@REDACTED Mon Jul 9 22:51:21 2018 From: oliver.korpilla@REDACTED (Oliver Korpilla) Date: Mon, 09 Jul 2018 22:51:21 +0200 Subject: [erlang-questions] Including function in configuration file In-Reply-To: References: <97239fa3-1e1c-4f6d-899f-f759b7e2964c@Spark> Message-ID: <01C5E91D-2347-41DD-A1DD-9D6F667C4643@gmx.de> Couldn't you store the code of the compiled module containing the function as binary in an list or binary literal, read it in and call it? Oliver On July 9, 2018 9:50:14 PM CEST, Roger Lipscombe wrote: >On 9 July 2018 at 20:16, Code Wiget wrote: >> So, for the ssl options such as: >> {reuse_session, fun()} {next_protocols_advertised, [binary()]} >> >> {user_lookup_fun, {fun(), term()}}, {psk_identity, string()}, >{srp_identity, >> {string(), string()}} >> >> You have to manually set the configuration parameters, and cannot set >them >> in a configuration file? > >Yes, but you _can_ come up with some other way to specify them in the >configuration file, and then convert that to an actual function before >you pass it to SSL options. > >We have something like this in our code: > >convert_ssl_opt({verify_opts, VerifyOpts}, Acc) -> > Opt = {verify_fun, {fun do_verify/3, VerifyOpts}}, > [Opt | Acc]; > >...which converts our invented 'verify_opts' into the required >'verify_fun', by using a do_verify function in the module that does >the conversion. >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -- Sent from my Android device with K-9 Mail. Please excuse my brevity. -------------- next part -------------- An HTML attachment was scrubbed... URL: From list1@REDACTED Mon Jul 9 23:03:58 2018 From: list1@REDACTED (Grzegorz Junka) Date: Mon, 9 Jul 2018 21:03:58 +0000 Subject: [erlang-questions] Including function in configuration file In-Reply-To: <97239fa3-1e1c-4f6d-899f-f759b7e2964c@Spark> References: <97239fa3-1e1c-4f6d-899f-f759b7e2964c@Spark> Message-ID: On 09/07/2018 18:57, Code Wiget wrote: > Hi, > > Say I want to include a function as an environment variable > > I can do this: > ?application:set_env(App, Key, NewValue). > > Is there any way to do this from a .config file? Such as: > ?[{my_app, [ {my_fun, #Fun}]}] > > ? this gives a compile error. > If you defined a function in the config how would you verify if it's correct? You will need to compile it first. In Erlang you can compile any arbitrary file directly in your application, see this for an example: https://github.com/yoonka/migresia/blob/master/src/migresia_migrations.erl#L193 So, theoretically, you could define a function as a string or binary in your config, then in the application write this to a file, compile into a binary (i.e. without writing the compiled module to a file) and then load directly from that binary and execute. But that sounds a bit weird and it's probably not what you need. Maybe you can just tell us what are you trying to accomplish? Best Greg -------------- next part -------------- An HTML attachment was scrubbed... URL: From codewiget95@REDACTED Mon Jul 9 23:06:28 2018 From: codewiget95@REDACTED (Code Wiget) Date: Mon, 9 Jul 2018 17:06:28 -0400 Subject: [erlang-questions] Including function in configuration file In-Reply-To: References: <97239fa3-1e1c-4f6d-899f-f759b7e2964c@Spark> Message-ID: Hi Greg, I sent this earlier, but it must not have gone through to everyone. I am trying to use special ssl options, for example: {reuse_session, fun()} {next_protocols_advertised, [binary()]} And {user_lookup_fun, {fun(), term()}}, {psk_identity, string()}, {srp_identity, {string(), string()}} Which require functions as input. This means that I can?t use a configuration file. Other members have suggested that I iterate over my environment variables and replace the ?fun()? with a function at run time, rather than using a .config file. I think this is the most straightforward approach. On Jul 9, 2018, 5:04 PM -0400, Grzegorz Junka , wrote: > > On 09/07/2018 18:57, Code Wiget wrote: > > Hi, > > > > Say I want to include a function as an environment variable > > > > I can do this: > > ?application:set_env(App, Key, NewValue). > > > > Is there any way to do this from a .config file? Such as: > > ?[{my_app, [ {my_fun, #Fun}]}] > > > > ? this gives a compile error. > > > > If you defined a function in the config how would you verify if it's correct? You will need to compile it first. In Erlang you can compile any arbitrary file directly in your application, see this for an example: > https://github.com/yoonka/migresia/blob/master/src/migresia_migrations.erl#L193 > > So, theoretically, you could define a function as a string or binary in your config, then in the application write this to a file, compile into a binary (i.e. without writing the compiled module to a file) and then load directly from that binary and execute. But that sounds a bit weird and it's probably not what you need. Maybe you can just tell us what are you trying to accomplish? > > Best > Greg -------------- next part -------------- An HTML attachment was scrubbed... URL: From list1@REDACTED Mon Jul 9 23:37:12 2018 From: list1@REDACTED (Grzegorz Junka) Date: Mon, 9 Jul 2018 21:37:12 +0000 Subject: [erlang-questions] Including function in configuration file In-Reply-To: References: <97239fa3-1e1c-4f6d-899f-f759b7e2964c@Spark> Message-ID: But you can specify here a function that you have written somewhere, then in that function read the configuration parameters that you want to use? For Erlang only the signature matters, i.e. that the function accepts the arguments? that the documentation says it should accept and that it returns the value it should return (e.g. boolean()). It's entirely up to you what the function does inside, e.g. it can execute some Java code, read a config file, or randomly return true/false. What I was more interested is why do you think you need to specify anything in configuration related to those functions, why they can't be just static functions implemented somewhere. Greg On 09/07/2018 21:06, Code Wiget wrote: > Hi Greg, > > I sent this earlier, but it must not have gone through to everyone. I > am trying to use special ssl options, for example: > > {reuse_session, fun()} {next_protocols_advertised, [binary()]} > > And > > {user_lookup_fun, {fun(), term()}}, {psk_identity, string()}, > {srp_identity, {string(), string()}} > > > Which require functions as input. This means that I can?t use a > configuration file. Other members have suggested that I iterate over > my environment variables and replace the ?fun()? with a function at > run time, rather than using a .config file. I think this is the most > straightforward approach. > > > On Jul 9, 2018, 5:04 PM -0400, Grzegorz Junka , wrote: >> >> On 09/07/2018 18:57, Code Wiget wrote: >>> Hi, >>> >>> Say I want to include a function as an environment variable >>> >>> I can do this: >>> ?application:set_env(App, Key, NewValue). >>> >>> Is there any way to do this from a .config file? Such as: >>> ?[{my_app, [ {my_fun, #Fun}]}] >>> >>> ? this gives a compile error. >>> >> >> If you defined a function in the config how would you verify if it's >> correct? You will need to compile it first. In Erlang you can compile >> any arbitrary file directly in your application, see this for an example: >> https://github.com/yoonka/migresia/blob/master/src/migresia_migrations.erl#L193 >> >> So, theoretically, you could define a function as a string or binary >> in your config, then in the application write this to a file, compile >> into a binary (i.e. without writing the compiled module to a file) >> and then load directly from that binary and execute. But that sounds >> a bit weird and it's probably not what you need. Maybe you can just >> tell us what are you trying to accomplish? >> >> Best >> Greg -------------- next part -------------- An HTML attachment was scrubbed... URL: From prakash.parmar@REDACTED Tue Jul 10 08:21:05 2018 From: prakash.parmar@REDACTED (Prakash Parmar) Date: Tue, 10 Jul 2018 06:21:05 +0000 Subject: [erlang-questions] Node Crash for inets config 'SocketType ssl' Message-ID: Hello, I have a web-server based on inets otp application and running completely fine over 'http' in order to support 'https' I have changed inets configuration as per the sample configuration located at Erlang's repo [1]. Here are the config file snippet I had changed/added, ... SocketType ssl SSLCertificateFile {{install_dir}}/config/www/certs/server.pem SSLCertificateKeyFile {{install_dir}}/config/www/certs/server.pem SSLVerifyClient 0 ... I have also generated certificate files[2] and kept it in above mentioned path. unfortunately node is crashing at startup and following logs is printed on shell. =CRASH REPORT==== 9-Jul-2018::12:13:50 === crasher: initial call: application_master:init/4 pid: <0.902.0> registered_name: [] exception exit: {{shutdown, {failed_to_start_child,httpd_sup, {shutdown, {failed_to_start_child, {httpd_instance_sup,any,8881,default}, {shutdown, {failed_to_start_child, {httpd_acceptor_sup,any,8881,default}, {shutdown, {failed_to_start_child, {httpd_acceptor_sup,any,8881,default}, {'EXIT', {function_clause, [{http_transport,start, [ssl], [{file,"http_transport.erl"},{line,54}]}, {httpd_acceptor,do_socket_start,1, [{file,"httpd_acceptor.erl"},{line,101}]}, {httpd_acceptor,do_init,4, [{file,"httpd_acceptor.erl"},{line,94}]}, {httpd_acceptor,acceptor_init,8, [{file,"httpd_acceptor.erl"},{line,82}]}, {proc_lib,init_p_do_apply,3, [{file,"proc_lib.erl"}, {line,247}]}]}}}}}}}}}}, {inets_app,start,[normal,[]]}} in function application_master:init/4 (application_master.erl, line 134) ancestors: [<0.901.0>] messages: [{'EXIT',<0.903.0>,normal}] links: [<0.901.0>,<0.739.0>] dictionary: [] trap_exit: true status: running heap_size: 987 stack_size: 27 reductions: 166 neighbours: Does anyone know what might be the problem ? I have looked into 'http_transport' module's code and it seems that start/1 function[3] is not accepting 'ssl' atom as an arity, Arity for this function is like {ssl, }. Any idea on this ? Did I missed anything ? / cheers, Prakash Parmar Reference, [1] https://github.com/erlang/otp/blob/master/lib/inets/examples/server_root/conf/ssl.conf https://github.com/erlang/otp/blob/master/lib/inets/examples/server_root/conf/httpd.conf [2] https://devcenter.heroku.com/articles/ssl-certificate-self https://stackoverflow.com/questions/991758/how-to-get-pem-file-from-key-and-crt-files [3] https://github.com/erlang/otp/blob/177a3470d598c892e0b7251cd2d9219aebcd3747/lib/inets/src/http_lib/http_transport.erl#L54 -------------- next part -------------- An HTML attachment was scrubbed... URL: From aseigo@REDACTED Tue Jul 10 09:12:10 2018 From: aseigo@REDACTED (Aaron Seigo) Date: Tue, 10 Jul 2018 09:12:10 +0200 Subject: [erlang-questions] Running a fleet of OS processes In-Reply-To: References: Message-ID: <649f6a67c0092f6a50afd7b686a0b8bc@mykolab.com> On 2018-07-09 16:33, Yevhenii Kurtov wrote: > - continiously poll their state (JSON RPC API) and report updated state > if > it changed since last poll Be careful with polling -> if each poll job takes 10ms of processing time, then in a perfect world (and the world is not perfect) the system can only handle 100 connections per core before simply running out of CPU time. If most of your targets are not regularly updating, then it's a real burn as targets with updates will have to wait until they get on the CPU while targets with nothing to report get in the way. The usual result is lag-under-load: polling tasks are not done back-to-back but spread out over time (e.g. every N seconds), and changes are relayed with a delay that increases in proportion to the number of polling targets. And of course, the world is not perfect. The erlang VM needs time on the CPU, whatever else your application does also needs CPU time, the OS itself and whatever other things are running will as well (e.g. your external processes). The BEAM will help somewhat with its ability to interleave processing between the various polling processes, but there are limits that polling brings with it. If you need to provide low-latency updates to an even moderate number of requests, polling will likely become your bottleneck. If at all possible, avoid polling and move to push-on-updates as close to your source of truth as you can. > Then there will be a pool of workers that will go and poll a fleet once > in a while. IME it is usually better to have one process per external exec for such tasks. The reason for this is that it allows concurrency of the polling with minimal fuss. If you serialize the polling in a single process, then the Nth poll target needs to wait until the (N-1)th polling jobs have been done. If you fire off a bunch of poll requests and wait for them to come back async, you have to write all the bookkeeping to keep track of which request goes with which poll target. Usually it is easier (and often faster ime) to allow the erlang schedulers to rotate through the set of processes doing polling, with each process handling one poll target. -- Aaron From fchschneider@REDACTED Tue Jul 10 09:26:26 2018 From: fchschneider@REDACTED (Frans Schneider) Date: Tue, 10 Jul 2018 09:26:26 +0200 Subject: [erlang-questions] Selecting records from Mnesia using partial key In-Reply-To: References: Message-ID: <43a5a279-4db1-dd20-9497-799fb482a29d@gmail.com> Nice, thanks Richard, I am trying to implement a XACML policy decision point [1, 2] to see if it can do authorization in a electronic health record system. I can not find much data and examples of its use and it is hard to say anything about things like the number of policies, distinct attributes etc. in a typical installation. Attributes are user defined and not defined by the standard, but it may be quite a few (hundreds?) and growing during the life-span of an application. In (academic) literature there is nothing mentioned on this point. It seems reasonable to assume attributes may be added but not removed from the system (they may become unused however). I like your idea a lot and, at least for a PoC, a nice option to get something working. Thanks, Frans [1] https://www.oasis-open.org/committees/download.php/2713/Brief_Introduction_to_XACML.html [2] http://docs.oasis-open.org/xacml/3.0/errata01/os/xacml-3.0-core-spec-errata01-os-complete.html On 07/09/2018 02:57 PM, Richard O'Keefe wrote: > You said that the number of attributes per *request* is 4 to 8, but not > how many > distinct attributes there may be in total.? If that number is not > unreasonably > high, say a couple of hundred, you could > (1) map distinct attributes to distinct non-negative integers > (2) map sets of attributes to bit strings (integers where bit k is 1 if > and only attribute k is in the set) > (3) test whether Policy_Attrs is a subset of Request_Attrs by asking > ? ? Policy_Attrs band Request_Attrs =:= Policy_Attrs > > > If a query has N attributes, there are 2**N - 1 non-empty subsets. > You could take a "subset" query and turn it into 2**N-1 "exact match" > queries > and form the union of the results.? Depending on the maximum number of > all attributes, various kinds of slicing and dicing might pay off, but > with respect, something about this bothers me. > > I think it would be helpful to describe the actual application in a little > more detail. > > On 9 July 2018 at 19:44, Frans Schneider > wrote: > > Yes, I know I had to be more specific, but this was one of those > Friday afternoon posts looking for an easy answer. > > The thing is, looking for applicable policies all combinations of > attributes from the request have to be tried: i.e. the number of > combinations becomes an issue. Fetching policies from Mnesia based > on their attributes is trivial using hashing. > > The number of policies in the Mnesia table may be up to 10K, maybe > 100K. The number of attributes per request, as far as I have seen, > varies mostly between 4 and 8. The repository has a primary key for > the policy id and a index key which is the hash of the attribute ids > used by that policy. The number of requests is high, as high as > possible, and come from applications making authorization calls. For > horizontal scaling, the repository should be distributed. > > Looking up policies probably should be implemented using some > digraph type of structure on top of some storage back-end, maybe a > graph database. I have seen some implementations of that but all > lack the possibility to remove or make changes to policies after the > graph has been created without rebuilding the whole graph. With the > regular changes made to authorizations, making changes to the graph > is mandatory. > > Maybe somebody did something before like this and I would like some > input. > > Frans > > [1] > > > On 07/08/2018 04:45 PM, Mikael Pettersson wrote: > > On Fri, Jul 6, 2018 at 1:34 PM, Frans Schneider > > wrote: > > Dear list, > > Before trying to reinvent the wheel, maybe somebody can > point me in the > right direction. > > I have a request with a variable set of attributes [A, B, > C...] and a Mnesia > table with policies, each applicable for a also variable set > of attributes > [X, Y, Z...]. Policies may be applicable for the same set of > attributes, in > which case all these policies have to be evaluated. > > A policy should be selected if its attributes is the set _or > a subset_ of > attributes from the request: i.e. if the request has the set > of attributes > [A, B] than all policies with attributes [A, B], [A] and [B] > should be > selected. > > Attributes currently are records holding two strings but > could be turned > into atoms. > > Does anybody know a nice way to implement this in Mnesia? > > > Without further information about or restrictions to your > problem, I guess the > simplest solution is to use a qlc to query the policies table, > and in the qlc > filter by available attributes. > > This is effectively going to traverse the entire table, so it > won't be > very efficient, > but it may be enough for your case (we don't know your table > size, number of > attributes, etc). > > If you want something more efficient, you'll need one or more > indices, i.e. > mappings from attributes (or sets of attributes) to applicable > policies.? Since > your input may contain a superset of a policy's attributes, > you'll have to > create it/them yourself rather than relying on mnesia's built-in > indexing support. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > From roger@REDACTED Tue Jul 10 17:13:18 2018 From: roger@REDACTED (Roger Lipscombe) Date: Tue, 10 Jul 2018 16:13:18 +0100 Subject: [erlang-questions] net_kernel:start without writing cookie file? Message-ID: When you start distribution with (e.g.) net_kernel:start([foo, shortnames]), Erlang writes ~/.erlang.cookie as the current user, with mode 600. If you inadvertently use sudo to run your escript, it creates the .erlang.cookie file owned by root. The next time you run your escript without sudo (because it wasn't needed), Erlang dies with a scary-looking error message. Since our particular escript immediately calls erlang:set_cookie, it's kinda pointless generating the cookie file. Is there any way to disable this behaviour, so that people who accidentally use 'sudo' don't get caught out? Thanks, Roger. From ingela.andin@REDACTED Tue Jul 10 18:03:50 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Tue, 10 Jul 2018 18:03:50 +0200 Subject: [erlang-questions] Node Crash for inets config 'SocketType ssl' In-Reply-To: References: Message-ID: Hi! Did you start the ssl application? Regards Ingela Erlang/OTP Team - Ericsson AB 2018-07-10 8:21 GMT+02:00 Prakash Parmar : > Hello, > > > I have a web-server based on inets otp application and running completely > fine over 'http' in order to support 'https' I have changed inets > configuration > > as per the sample configuration located at Erlang's repo [1]. > > > Here are the config file snippet I had changed/added, > > ... > SocketType ssl > SSLCertificateFile {{install_dir}}/config/www/certs/server.pem > SSLCertificateKeyFile {{install_dir}}/config/www/certs/server.pem > SSLVerifyClient 0 > ... > > I have also generated certificate files[2] and kept it in above mentioned > path. > > unfortunately node is crashing at startup and following logs is printed on > shell. > > =CRASH REPORT==== 9-Jul-2018::12:13:50 === > crasher: > initial call: application_master:init/4 > pid: <0.902.0> > registered_name: [] > exception exit: {{shutdown, > {failed_to_start_child,httpd_sup, > {shutdown, > {failed_to_start_child, > {httpd_instance_sup,any,8881,default}, > {shutdown, > {failed_to_start_child, > {httpd_acceptor_sup,any,8881,default}, > {shutdown, > {failed_to_start_child, > {httpd_acceptor_sup,any,8881,default}, > {'EXIT', > {function_clause, > [{http_transport,start, > [ssl], > [{file,"http_transport.erl"},{line,54}]}, > {httpd_acceptor,do_socket_start,1, > [{file,"httpd_acceptor.erl"}, > {line,101}]}, > {httpd_acceptor,do_init,4, > [{file,"httpd_acceptor.erl"},{line,94}]}, > {httpd_acceptor,acceptor_init,8, > [{file,"httpd_acceptor.erl"},{line,82}]}, > {proc_lib,init_p_do_apply,3, > [{file,"proc_lib.erl"}, > {line,247}]}]}}}}}}}}}}, > {inets_app,start,[normal,[]]}} > in function application_master:init/4 (application_master.erl, line > 134) > ancestors: [<0.901.0>] > messages: [{'EXIT',<0.903.0>,normal}] > links: [<0.901.0>,<0.739.0>] > dictionary: [] > trap_exit: true > status: running > heap_size: 987 > stack_size: 27 > reductions: 166 > neighbours: > > > > Does anyone know what might be the problem ? > > I have looked into 'http_transport' module's code and it seems that > start/1 function[3] is not accepting 'ssl' atom as an arity, > Arity for this function is like {ssl, }. Any idea > on this ? Did I missed anything ? > > / cheers, > Prakash Parmar > > > > Reference, > [1] https://github.com/erlang/otp/blob/master/lib/inets/ > examples/server_root/conf/ssl.conf > https://github.com/erlang/otp/blob/master/lib/inets/ > examples/server_root/conf/httpd.conf > > [2] https://devcenter.heroku.com/articles/ssl-certificate-self > https://stackoverflow.com/questions/991758/how-to-get- > pem-file-from-key-and-crt-files > > [3] https://github.com/erlang/otp/blob/177a3470d598c892e0b7251cd2d921 > 9aebcd3747/lib/inets/src/http_lib/http_transport.erl#L54 > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From levi@REDACTED Tue Jul 10 22:13:05 2018 From: levi@REDACTED (Levi Aul) Date: Tue, 10 Jul 2018 13:13:05 -0700 Subject: [erlang-questions] term_to_binary and large data structures In-Reply-To: <78b98aa2f5173e40bda7d30ce73dd929@mykolab.com> References: <131a8c8d06640db106b71fd1ef246fe7@mykolab.com> <81bb5c98-5a6a-4069-91d9-9cbd3eba662c@Spark> <78b98aa2f5173e40bda7d30ce73dd929@mykolab.com> Message-ID: It could be possible to expose the distribution protocol's `term_to_binary/1` atom cache for external use by other `term_to_binary/1` users. The atom cache is, itself, a kind of streaming dictionary compression; it replaces a protocol or format with one outermost message type (a serialized term) with one with two outermost message types: a serialized term containing potential dictionary references; or an update to the dictionary. The dictionary, in this case, contains whole terms (atoms) only. This is essentially the same as what HPACK does for HTTP message streams. HPACK has a very simple API (see https://github.com/twitter/hpack), and the Erlang equivalent could be even simpler. I'll write up a proposal for this. On Wed, Jul 4, 2018 at 5:56 AM, Aaron Seigo wrote: > On 2018-07-04 13:23, Micha? Muska?a wrote: > > I also believe the current format for maps, which is key1, value1, key2, >> value2, ... is >> not that great for compression. Often, you'd have maps with exact the >> same keys >> (especially in Elixir with structs), and there, a pattern of key1, key2, >> ..., value1, >> value2, ..., should be much better (since the entire keys structure could >> be compressed >> between similar maps). >> > > I can confirm that this is an accurate observation. While not done in > Packer, there are notes about this in Packer's code which was the result of > some experiments around this. For maps, and *especially* structs in Elixir, > this can indeed be a huge win for some messages. > > Even more farther afield: what would be a real win, but much harder to > accomplish, would be streaming compression. There are protocols (e.g. imap) > which can offload compression of common patterns between messages to > entries in the compression look up tables. The compression is applied to > the entire network stream for the life of the connection and all data that > goes through it is compressed in a single stream. So when a message has the > same byte sequence as a previous message the comrpessor ends up turning > that into a reference to an already existing entry in a look-up table. > > The hard(er) part for BEAM distribution and this sort of thing would be > managing the size of the lookup table as these connections are meant to be > both long-lived and not consume infinite resources ;) So unlike > (relatively) short-lived and highly repetitive imap connections, this would > probably require something custom made to task which would keep a cache of > most used terms (with all that comes with that, including cache > invalidation). > > Compared to just working on the term serialization, that feels a bit like > rocket science at the moment. But getting maps in the same message more > efficiently packed is definitely doable :) > > > -- > Aaron > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From levi@REDACTED Tue Jul 10 22:49:48 2018 From: levi@REDACTED (Levi Aul) Date: Tue, 10 Jul 2018 13:49:48 -0700 Subject: [erlang-questions] RFC: expose dist protocol's term_to_binary/2 atom cache Message-ID: Right now, the distribution protocol gets to play with toys that the rest of us don?t: it can make sequential term_to_binary/1 calls more space-efficient by lifting the atoms out of each term, converting them into cheap EXT_ATOM_CACHE_REFs. It then emits the atom-cache updates as headers in each data message. I propose moving this logic to a more Erlang-userland accessible level. Rather than atom caches being something that happen internally in dist.c, atom caches could be exposed as a general feature of the External Term Format in external.c. Users could create new atom caches through a BIF (e.g. make_atom_cache/0) and then fold the terms they wish to encode/decode over the atom cache, which would either return a new atom cache (if the atom cache is an exposed term) or would mutate the underlying data-structure of the atom cache (if the atom cache is an opaque handle.) Users could then use another BIF to ask the atom cache to create a binary description of an update. The distribution protocol could then be reimplemented backwards-compatibly in terms of these new BIFs, where the atom cache update in each data message's header would simply be the return value of the "describe atom cache update" BIF. I've outlined below a few potential API designs for this idea. I'd like to get feedback what people like/dislike about them. If there's clear community consensus that one of these ideas is good, I'll move forward with either a patch or an EEP (I personally feel this isn't the kind of big-deal change that warrants an EEP, but correct me if I'm wrong.) 1 - Erlang-exposed atom cache Using the hypothetical BIF make_atom_cache/0, a hypothetical atom_cache option for term_to_binary/2, and the hypothetical BIF binary_to_term/2 which also takes an atom_cache option. Both term_to_binary/2 and binary_to_term/2, when passed the atom_cache option, would return a {Result, UpdatedAtomCache} tuple. terms_to_binaries(Terms) -> terms_to_binaries(Terms, erlang:make_atom_cache()). terms_to_binaries(Terms, ACache0) -> terms_to_binaries(Terms, ACache0, ACache0, []). terms_to_binaries([], ACache0, ACache0, Bins) -> lists:reverse(Bins). terms_to_binaries([], ACache0, ACacheFinal, Bins) -> ACacheDiff = erlang:diff_atom_cache(ACache0, ACacheFinal), ACacheDiffBin = erlang:term_to_binary(ACacheDiff), [ACacheDiffBin | lists:reverse(Bins)]. terms_to_binaries([Term | Terms], ACache0, ACachePrev, Bins) -> {Bin, ACacheCurr} = erlang:term_to_binary(Term, {atom_cache, ACachePrev}), terms_to_binaries(Terms, ACache0, ACacheCurr, [Bin | Bins]). binaries_to_terms(Bins) -> binaries_to_terms(Terms, erlang:make_atom_cache()). binaries_to_terms(Bins, ACache0) -> binaries_to_terms(Bins, ACache0, []). binaries_to_terms([], ACache, Terms) -> {lists:reverse(Terms), ACache}. binaries_to_terms([Bin | Bins], ACache0, Terms) -> {Term, ACache1} = erlang:binary_to_term(Bin, [{atom_cache, ACache0}]), binaries_to_terms(Bins, ACache1, [Term | Terms]). 2 - Exposed atom cache, but opaque transaction handles Design #1 assumes you want functional-data-structure semantics for atom caches the whole way through the encoding/decoding process, which can be slow, and which really makes little sense given that there is no real use for the intermediate atom-cache representations. An alternate design would make the intermediate atom-cache representations opaque?you?d have a handle into an atom-cache ?transaction? (a piece of opaque ERTS-mutable data in the owner process?s heap, like a NIF handle), and committing the transaction would destroy this handle and return a regular Erlang-visible representation of the updated atom-cache and a diff from the start of the transaction: terms_to_binaries(Terms) -> terms_to_binaries(Terms, erlang:make_atom_cache()). terms_to_binaries(Terms, ACache) -> terms_to_binaries(Terms, atom_cache:transaction(ACache), []). terms_to_binaries([], ACacheTx, Bins) -> {_UpdatedACache, ACacheDiff} = atom_cache:commit(ACacheTx), ACacheDiffBin = erlang:term_to_binary(ACacheDiff), [ACacheDiffBin | lists:reverse(Bins)]. terms_to_binaries([Term | Terms], ACacheTx, Bins) -> Bin = erlang:term_to_binary(Term, {atom_cache, ACacheTx}), terms_to_binaries(Terms, ACacheTx, [Bin | Bins]). binaries_to_terms(Bins) -> binaries_to_terms(Terms, erlang:make_atom_cache()). binaries_to_terms(Bins, ACache) -> binaries_to_terms(Bins, atom_cache:transaction(ACache), []). binaries_to_terms([], ACacheTx, Terms) -> {UpdatedACache, _ACacheDiff} = atom_cache:commit(ACacheTx), {lists:reverse(Terms), UpdatedACache}. binaries_to_terms([Bin | Bins], ACacheTx, Terms) -> Term = erlang:binary_to_term(Bin, [{atom_cache, ACacheTx}]), binaries_to_terms(Bins, ACacheTx, [Term | Terms]). This still introduces a binary_to_term/2 BIF, but no longer requires term_to_binary/2 or binary_to_term/2 to have multiple potential return types. It also would require the new BIFs atom_cache:transaction/1 and atom_cache:commit/1, as well as the make_atom_cache/0 BIF. 3 - Opaque atom cache (with or without transactions) This overhead savings is meaningful, but potentially small if the client is using term_to_binary/2 for a streaming protocol, where the atom-cache transactions would have to be limited to small batch sizes in order to emit chunks in a timely manner. Further savings could be made if, rather than the atom cache being exposed as a term between transactions, the atom cache itself was an opaque handle for its entire lifetime. For example, an atom cache could exist as an ETS table using the special table-type atom_cache, with its own backing data-structure optimized for this use-case. This would handily provide a framework for shared-access concurrency of atom caches?concurrent decoder processes and even concurrent encoder processes could be backed by a shared atom cache, allowing terms from the same port, or destined for the same port, to be encoded/decoded concurrently, without generating redundant atom-cache-update binaries in the encoded stream. Transactions, if still desirable, would still need to exist as separate opaque state-tracking objects, in order for the transaction-commits to produce valid atom-cache diffs corresponding to the terms that have been encoded. But, if updates to the atom_cache data structure are cheap enough, transactions may able to be discarded as an approach in favour of each individual term_to_binary/2 and binary_to_term/2 with the atom_cache option passed performing an atomic write to the atom cache table, and returning an individual-operation diff. If, under an atomic-updates design, term_to_binary/2 simply prepended the encoded atom-cache diff to its own encoded term, then this would make the APIs of the two ETF functions entirely backwards-compatible with their forms today, just now with each having side-effects on an optional passed atom-cache and potentially different outputs (in content, but not in type) when the atom_cache option is passed. ? -------------- next part -------------- An HTML attachment was scrubbed... URL: From prakash.parmar@REDACTED Wed Jul 11 07:12:31 2018 From: prakash.parmar@REDACTED (Prakash Parmar) Date: Wed, 11 Jul 2018 05:12:31 +0000 Subject: [erlang-questions] Node Crash for inets config 'SocketType ssl' In-Reply-To: References: , Message-ID: Hello Ingela, Thanks for your response ? I'm using rebar3 for release. I have mentioned ssl application in config file prior to inets application(though sequence doesn't matter) and as per my understanding rebar3 will take care of start sequence and I don't think so there is an option to define application start sequence explicitly. Am I right ? Let me know if there is any way to make sure to start ssl application before inets application. /Cheers, Prakash Parmar ________________________________ From: Ingela Andin Sent: Tuesday, July 10, 2018 9:33:50 PM To: Prakash Parmar Cc: Erlang Questions Subject: Re: [erlang-questions] Node Crash for inets config 'SocketType ssl' Hi! Did you start the ssl application? Regards Ingela Erlang/OTP Team - Ericsson AB 2018-07-10 8:21 GMT+02:00 Prakash Parmar >: Hello, I have a web-server based on inets otp application and running completely fine over 'http' in order to support 'https' I have changed inets configuration as per the sample configuration located at Erlang's repo [1]. Here are the config file snippet I had changed/added, ... SocketType ssl SSLCertificateFile {{install_dir}}/config/www/certs/server.pem SSLCertificateKeyFile {{install_dir}}/config/www/certs/server.pem SSLVerifyClient 0 ... I have also generated certificate files[2] and kept it in above mentioned path. unfortunately node is crashing at startup and following logs is printed on shell. =CRASH REPORT==== 9-Jul-2018::12:13:50 === crasher: initial call: application_master:init/4 pid: <0.902.0> registered_name: [] exception exit: {{shutdown, {failed_to_start_child,httpd_sup, {shutdown, {failed_to_start_child, {httpd_instance_sup,any,8881,default}, {shutdown, {failed_to_start_child, {httpd_acceptor_sup,any,8881,default}, {shutdown, {failed_to_start_child, {httpd_acceptor_sup,any,8881,default}, {'EXIT', {function_clause, [{http_transport,start, [ssl], [{file,"http_transport.erl"},{line,54}]}, {httpd_acceptor,do_socket_start,1, [{file,"httpd_acceptor.erl"},{line,101}]}, {httpd_acceptor,do_init,4, [{file,"httpd_acceptor.erl"},{line,94}]}, {httpd_acceptor,acceptor_init,8, [{file,"httpd_acceptor.erl"},{line,82}]}, {proc_lib,init_p_do_apply,3, [{file,"proc_lib.erl"}, {line,247}]}]}}}}}}}}}}, {inets_app,start,[normal,[]]}} in function application_master:init/4 (application_master.erl, line 134) ancestors: [<0.901.0>] messages: [{'EXIT',<0.903.0>,normal}] links: [<0.901.0>,<0.739.0>] dictionary: [] trap_exit: true status: running heap_size: 987 stack_size: 27 reductions: 166 neighbours: Does anyone know what might be the problem ? I have looked into 'http_transport' module's code and it seems that start/1 function[3] is not accepting 'ssl' atom as an arity, Arity for this function is like {ssl, }. Any idea on this ? Did I missed anything ? / cheers, Prakash Parmar Reference, [1] https://github.com/erlang/otp/blob/master/lib/inets/examples/server_root/conf/ssl.conf https://github.com/erlang/otp/blob/master/lib/inets/examples/server_root/conf/httpd.conf [2] https://devcenter.heroku.com/articles/ssl-certificate-self https://stackoverflow.com/questions/991758/how-to-get-pem-file-from-key-and-crt-files [3] https://github.com/erlang/otp/blob/177a3470d598c892e0b7251cd2d9219aebcd3747/lib/inets/src/http_lib/http_transport.erl#L54 _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From pablo.platt@REDACTED Wed Jul 11 08:29:08 2018 From: pablo.platt@REDACTED (pablo platt) Date: Wed, 11 Jul 2018 09:29:08 +0300 Subject: [erlang-questions] Erlang closed the connection Message-ID: Hi, I have several docker containers running Erlang release. The host and the containers use Ubuntu 18.04. With OTP 20 I had no issues. Since I upgraded to OTP 21 I'm getting an error: run_erl[97]: Erlang closed the connection. After this error, the Erlang node isn't running. I don't see a crash dump or anything in the release log folder. What can cause this error and how can I debug it? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangsiri@REDACTED Wed Jul 11 11:25:16 2018 From: erlangsiri@REDACTED (Siri Hansen) Date: Wed, 11 Jul 2018 11:25:16 +0200 Subject: [erlang-questions] r21 logger difficulties In-Reply-To: <5983CF5F-3E08-4CF2-BEC3-B5EF15F95CCA@gmail.com> References: <41EE5540-D1D6-4C6E-9140-B4251C6988D9@gmail.com> <5983CF5F-3E08-4CF2-BEC3-B5EF15F95CCA@gmail.com> Message-ID: Hi again, Mark! I see that you set the handler level to debug in the sys.config, but I can't see that the primary level is set? Please refer to the Kernel User's Guide, http://erlang.org/doc/apps/kernel/logger_chapter.html, for a description of how primary level check and -filters are applied prior to all handler level checks and -filters. (short version: if a log event does not pass the primary level check, it is discarded and will never hit any handler). Primary level is 'notice' by default, and handler levels are 'all' by default. What I mean is that your sys.config should look something like this: {kernel, [{logger, [{handler, default, logger_std_h, #{level => debug, config => #{type => {file,"log/erlang.log"}}, formatter => {logger_formatter, #{template => [time," ",pid," ",msg,"\n"]}}} }] }, {logger_level, all} ] } Den man. 9. jul. 2018 kl. 19:22 skrev Mark Geib : > So after some more debugging, it appears that if I use ?debug? or ?info? > in either the sys.config logger config for the logging level, or as the > level of log message I see nothing. If I use any of the other levels it > appears to work as expected. All the combinations I tried worked as well, > i.e. if I set the log level in the config to ?notice? and then log with > logger:emergency(), it works fine. > > Mark. > > On Jul 9, 2018, at 1:33 AM, Siri Hansen wrote: > > Hi Mark, you just missed that the primary log level by default is > 'notice', which means that 'info' is rejected by the primary log level > check. If you do logger:notice("test message") instead, it should be > printed. To even print 'info', set the kernel configuration parameter > logger_level to 'info', 'debug' or 'all' in your sys config, or set it in > runtime with logger:set_primary_config(level,Level). > > Regards > /siri > > Den fre. 6. jul. 2018 kl. 20:44 skrev Mark Geib : > >> I decided to take a look at the new logger in R21, but I am not able to >> produce any output. >> >> In my sys.config I have the following: >> {kernel, >> [{logger, >> [{handler, default, logger_std_h, >> #{level => debug, >> config => #{type => {file,"log/erlang.log"}}, >> formatter => {logger_formatter, #{template => [time," ",pid," >> ",msg,"\n"]}}} >> }] >> }] >> } >> >> And in my code I do something like logger:info(?test message?), but I >> never see any output to the file. I see the file log/erlang.log created, >> but always empty. >> >> I must be missing something, but I have read through the docs, quickly. >> >> Any pointers would be appreciated. >> >> Mark. >> _______________________________________________ >> 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 Wed Jul 11 13:35:07 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 11 Jul 2018 13:35:07 +0200 Subject: [erlang-questions] Node Crash for inets config 'SocketType ssl' In-Reply-To: References: Message-ID: Hi! Well I am no rebar3 expert, but inets does not list ssl as a dependency as it is an "optional" dependency. You can check with application:which_applications() to see if it was started. Regards Ingela Erlang/OTP team - Ericsson AB 2018-07-11 7:12 GMT+02:00 Prakash Parmar : > Hello Ingela, > > > Thanks for your response ?? > > > I'm using rebar3 for release. I have mentioned ssl application in config > file prior to inets application(though sequence doesn't matter) and as > per my understanding rebar3 will take care of start sequence and I don't > think so there is an option to define application start sequence > explicitly. Am I right ? > > > Let me know if there is any way to make sure to start ssl application > before inets application. > > > /Cheers, > > Prakash Parmar > > ------------------------------ > *From:* Ingela Andin > *Sent:* Tuesday, July 10, 2018 9:33:50 PM > *To:* Prakash Parmar > *Cc:* Erlang Questions > *Subject:* Re: [erlang-questions] Node Crash for inets config 'SocketType > ssl' > > Hi! > > Did you start the ssl application? > > Regards Ingela Erlang/OTP Team - Ericsson AB > > > > > 2018-07-10 8:21 GMT+02:00 Prakash Parmar : > > Hello, > > > I have a web-server based on inets otp application and running completely > fine over 'http' in order to support 'https' I have changed inets > configuration > > as per the sample configuration located at Erlang's repo [1]. > > > Here are the config file snippet I had changed/added, > > ... > SocketType ssl > SSLCertificateFile {{install_dir}}/config/www/certs/server.pem > SSLCertificateKeyFile {{install_dir}}/config/www/certs/server.pem > SSLVerifyClient 0 > ... > > I have also generated certificate files[2] and kept it in above mentioned > path. > > unfortunately node is crashing at startup and following logs is printed on > shell. > > =CRASH REPORT==== 9-Jul-2018::12:13:50 === > crasher: > initial call: application_master:init/4 > pid: <0.902.0> > registered_name: [] > exception exit: {{shutdown, > {failed_to_start_child,httpd_sup, > {shutdown, > {failed_to_start_child, > {httpd_instance_sup,any,8881,default}, > {shutdown, > {failed_to_start_child, > {httpd_acceptor_sup,any,8881,default}, > {shutdown, > {failed_to_start_child, > {httpd_acceptor_sup,any,8881,default}, > {'EXIT', > {function_clause, > [{http_transport,start, > [ssl], > [{file,"http_transport.erl"},{line,54}]}, > {httpd_acceptor,do_socket_start,1, > [{file,"httpd_acceptor.erl"}, > {line,101}]}, > {httpd_acceptor,do_init,4, > [{file,"httpd_acceptor.erl"},{line,94}]}, > {httpd_acceptor,acceptor_init,8, > [{file,"httpd_acceptor.erl"},{line,82}]}, > {proc_lib,init_p_do_apply,3, > [{file,"proc_lib.erl"}, > {line,247}]}]}}}}}}}}}}, > {inets_app,start,[normal,[]]}} > in function application_master:init/4 (application_master.erl, line > 134) > ancestors: [<0.901.0>] > messages: [{'EXIT',<0.903.0>,normal}] > links: [<0.901.0>,<0.739.0>] > dictionary: [] > trap_exit: true > status: running > heap_size: 987 > stack_size: 27 > reductions: 166 > neighbours: > > > > Does anyone know what might be the problem ? > > I have looked into 'http_transport' module's code and it seems that > start/1 function[3] is not accepting 'ssl' atom as an arity, > Arity for this function is like {ssl, }. Any idea > on this ? Did I missed anything ? > > / cheers, > Prakash Parmar > > > > Reference, > [1] https://github.com/erlang/otp/blob/master/lib/inets/exam > ples/server_root/conf/ssl.conf > https://github.com/erlang/otp/blob/master/lib/inets/example > s/server_root/conf/httpd.conf > > [2] https://devcenter.heroku.com/articles/ssl-certificate-self > https://stackoverflow.com/questions/991758/how-to-get-pem- > file-from-key-and-crt-files > > [3] https://github.com/erlang/otp/blob/177a3470d598c892e0b72 > 51cd2d9219aebcd3747/lib/inets/src/http_lib/http_transport.erl#L54 > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlangsiri@REDACTED Wed Jul 11 16:14:40 2018 From: erlangsiri@REDACTED (Siri Hansen) Date: Wed, 11 Jul 2018 16:14:40 +0200 Subject: [erlang-questions] r21 logger difficulties In-Reply-To: References: <41EE5540-D1D6-4C6E-9140-B4251C6988D9@gmail.com> <5983CF5F-3E08-4CF2-BEC3-B5EF15F95CCA@gmail.com> Message-ID: Sorry, there's a bug in OTP-21.0 which does not allow the value 'all' for 'logger_level', so you need to specify 'debug' instead: {kernel, [{logger, [{handler, default, logger_std_h, #{level => debug, config => #{type => {file,"log/erlang.log"}}, formatter => {logger_formatter, #{template => [time," ",pid," ",msg,"\n"]}}} }] }, {logger_level, debug} ] } Den ons. 11. jul. 2018 kl. 11:25 skrev Siri Hansen : > Hi again, Mark! > > I see that you set the handler level to debug in the sys.config, but I > can't see that the primary level is set? Please refer to the Kernel User's > Guide, http://erlang.org/doc/apps/kernel/logger_chapter.html, for a > description of how primary level check and -filters are applied prior to > all handler level checks and -filters. (short version: if a log event does > not pass the primary level check, it is discarded and will never hit any > handler). > > Primary level is 'notice' by default, and handler levels are 'all' by > default. > > What I mean is that your sys.config should look something like this: > > {kernel, > [{logger, > [{handler, default, logger_std_h, > #{level => debug, > config => #{type => {file,"log/erlang.log"}}, > formatter => {logger_formatter, #{template => [time," ",pid," > ",msg,"\n"]}}} > }] > }, > {logger_level, all} > ] > } > > Den man. 9. jul. 2018 kl. 19:22 skrev Mark Geib : > >> So after some more debugging, it appears that if I use ?debug? or ?info? >> in either the sys.config logger config for the logging level, or as the >> level of log message I see nothing. If I use any of the other levels it >> appears to work as expected. All the combinations I tried worked as well, >> i.e. if I set the log level in the config to ?notice? and then log with >> logger:emergency(), it works fine. >> >> Mark. >> >> On Jul 9, 2018, at 1:33 AM, Siri Hansen wrote: >> >> Hi Mark, you just missed that the primary log level by default is >> 'notice', which means that 'info' is rejected by the primary log level >> check. If you do logger:notice("test message") instead, it should be >> printed. To even print 'info', set the kernel configuration parameter >> logger_level to 'info', 'debug' or 'all' in your sys config, or set it in >> runtime with logger:set_primary_config(level,Level). >> >> Regards >> /siri >> >> Den fre. 6. jul. 2018 kl. 20:44 skrev Mark Geib : >> >>> I decided to take a look at the new logger in R21, but I am not able to >>> produce any output. >>> >>> In my sys.config I have the following: >>> {kernel, >>> [{logger, >>> [{handler, default, logger_std_h, >>> #{level => debug, >>> config => #{type => {file,"log/erlang.log"}}, >>> formatter => {logger_formatter, #{template => [time," ",pid," >>> ",msg,"\n"]}}} >>> }] >>> }] >>> } >>> >>> And in my code I do something like logger:info(?test message?), but I >>> never see any output to the file. I see the file log/erlang.log created, >>> but always empty. >>> >>> I must be missing something, but I have read through the docs, quickly. >>> >>> Any pointers would be appreciated. >>> >>> Mark. >>> _______________________________________________ >>> 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 Wed Jul 11 16:33:34 2018 From: roger@REDACTED (Roger Lipscombe) Date: Wed, 11 Jul 2018 15:33:34 +0100 Subject: [erlang-questions] Logging level of "SSL: Socket error" Message-ID: The report changed from 'error_logger:info_report' in OTP-20.x to 'error_logger:error_report' in OTP-21.x (and then to ?LOG_ERROR in master). This now results in a lot of noise in our error reporting, because we get "SSL: Socket error: etimedout #012" about 10 times a minute. Any chance this change could be reverted, please? Related: http://erlang.org/pipermail/erlang-questions/2016-December/091046.html Thanks, Roger. From dane@REDACTED Wed Jul 11 18:29:41 2018 From: dane@REDACTED (Maxim Fedorov) Date: Wed, 11 Jul 2018 16:29:41 +0000 Subject: [erlang-questions] Debugging scheduler not responding to erts_schedule_misc_aux_work In-Reply-To: <1e549a8a2a9f3aa704bba2a1c6e32bff.squirrel@mail.alumni.caltech.edu> References: <9B6C45BE-65C2-4DB1-8985-D7843ED7AB64@whatsapp.com> <1e549a8a2a9f3aa704bba2a1c6e32bff.squirrel@mail.alumni.caltech.edu> Message-ID: <1AF7EA97-AEFB-49CC-8ECC-22E7D0F3F0B8@whatsapp.com> Thanks, Anthony. This patch (and Erlang 20.3.8, ERTS 9.3.3.1) does not fix the problem. Same issue has been observed (2 servers out of 384 stopped responding to aux work). I believe it's a different issue. ?On 6/28/18, 18:14, "anthonym@REDACTED" wrote: It may or may not apply but we had a similar problem with system level work being scheduled on freed processes, and have been debugging it with Ericsson via https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.erlang.org_browse_ERL-2D573&d=DwIDaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=0rT1IQzTc-5vHQf8ht6-x-ib_QvAEDJvef2Q98CuKgI&m=To7mEUnu73Ram_9CzpEXWHPvoyDBDz5HDUpb2LyN8p0&s=-TFczFM6WlUROTl7JqcN8u6DmWN3djIS9xhIBlNWgJc&e= for the last few months. There's a branch of 20 in one of the later comments which might help, and might be worth a try. HTH, -Anthony > I?m trying to debug some weird condition when any misc system task hangs. > It seems to affect OTP 20 (but not 16) on FreeBSD 10.3 and 11. > > It is a rare problem happening after 5-7 days under some load (~40% cpu > average on a 48 cores server). > > There is also a problem with erlang:statistics(runtime), affected by this > bug in FreeBSD kernel: > https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freebsd.org_bugzilla_show-5Fbug.cgi-3Fid-3D227689&d=DwIDaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=0rT1IQzTc-5vHQf8ht6-x-ib_QvAEDJvef2Q98CuKgI&m=To7mEUnu73Ram_9CzpEXWHPvoyDBDz5HDUpb2LyN8p0&s=9ADTx_DQfyQVR8StEXx8AlI49seSh0G6lW-yqem4sIg&e= (so > statistics:runtime() always returns the same value), however I doubt it > can affect anything. > > What happens: there are several calls, e.g. > erlang:statistics(garbage_collection), ets:all(), > erts_internal:system_check() and few more. All of them do > erts_schedule_misc_aux_work. A misc aux work item is put into every > scheduler queue, and it seems that all of them except one respond. VM is > still working, all other processes are fine, but the one that did the call > is waiting in erlang:gc_info/2 (or another corresponding function), with > counter equals to 1. Since there is no timeout in receive statement, it > waits forever. > > How do I debug this? Is there any way to find a scheduler that misbehaves? > It is one of the normal schedulers. I?m using gdb to attach to BEAM VM. > > Unfortunately, I cannot run debug VM (it is not able to handle the load). > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > https://urldefense.proofpoint.com/v2/url?u=http-3A__erlang.org_mailman_listinfo_erlang-2Dquestions&d=DwIDaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=0rT1IQzTc-5vHQf8ht6-x-ib_QvAEDJvef2Q98CuKgI&m=To7mEUnu73Ram_9CzpEXWHPvoyDBDz5HDUpb2LyN8p0&s=v-L1XxeW7SHFxLJvBtf9oVk7FY7XgrzBtT7WvHaYEmw&e= > From ingela.andin@REDACTED Wed Jul 11 18:48:37 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 11 Jul 2018 18:48:37 +0200 Subject: [erlang-questions] Logging level of "SSL: Socket error" In-Reply-To: References: Message-ID: Hi Roger! git branch * (HEAD detached at OTP-21.0.2) git blame -L 2742,2749 ssl_connection.erl fbbf7a98975 (Ingela Anderton Andin 2017-08-31 18:31:06 +0200 2742) log_alert(true, Role, ProtocolName, StateName, #alert{role = Role} = Alert) -> fbbf7a98975 (Ingela Anderton Andin 2017-08-31 18:31:06 +0200 2743) Txt = ssl_alert:own_alert_txt(Alert), fbbf7a98975 (Ingela Anderton Andin 2017-08-31 18:31:06 +0200 2744) error_logger:info_report(io_lib:format("~s ~p: In state ~p ~s\n", [ProtocolName, Role, StateName, Txt])); fbbf7a98975 (Ingela Anderton Andin 2017-08-31 18:31:06 +0200 2745) log_alert(true, Role, ProtocolName, StateName, Alert) -> 6c8a0271f75 (Ingela Anderton Andin 2016-08-12 12:17:47 +0200 2746) Txt = ssl_alert:alert_txt(Alert), fbbf7a98975 (Ingela Anderton Andin 2017-08-31 18:31:06 +0200 2747) error_logger:info_report(io_lib:format("~s ~p: In state ~p ~s\n", [ProtocolName, Role, StateName, Txt])); fbbf7a98975 (Ingela Anderton Andin 2017-08-31 18:31:06 +0200 2748) log_alert(false, _, _, _, _) -> 6c8a0271f75 (Ingela Anderton Andin 2016-08-12 12:17:47 +0200 2749) ok. So this was not changed in the ssl application for OTP-21. In the master branch, we have started to use logger and the plan is that log_alert true will be same as setting log level notice that is the default log level. We have also added a debug level and possibility to set the level. Maybe there is something unforeseen in logger or logger/lager interaction? Regards Ingela Erlang/OTP team- Ericsson AB 2018-07-11 16:33 GMT+02:00 Roger Lipscombe : > The report changed from 'error_logger:info_report' in OTP-20.x to > 'error_logger:error_report' in OTP-21.x (and then to ?LOG_ERROR in > master). > > This now results in a lot of noise in our error reporting, because we > get "SSL: Socket error: etimedout #012" about 10 times a minute. > > Any chance this change could be reverted, please? > > Related: http://erlang.org/pipermail/erlang-questions/2016- > December/091046.html > > Thanks, > Roger. > _______________________________________________ > 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 Wed Jul 11 19:27:49 2018 From: roger@REDACTED (Roger Lipscombe) Date: Wed, 11 Jul 2018 18:27:49 +0100 Subject: [erlang-questions] Logging level of "SSL: Socket error" In-Reply-To: References: Message-ID: https://github.com/erlang/otp/blob/OTP-21.0/lib/ssl/src/ssl_connection.erl#L1341-L1342 Report = io_lib:format("SSL: Socket error: ~p ~n", [Reason]), error_logger:error_report(Report), On 11 July 2018 at 17:48, Ingela Andin wrote: > Hi Roger! > > git branch > > * (HEAD detached at OTP-21.0.2) > > > git blame -L 2742,2749 ssl_connection.erl > > > fbbf7a98975 (Ingela Anderton Andin 2017-08-31 18:31:06 +0200 2742) > log_alert(true, Role, ProtocolName, StateName, #alert{role = Role} = Alert) > -> > > fbbf7a98975 (Ingela Anderton Andin 2017-08-31 18:31:06 +0200 2743) Txt = > ssl_alert:own_alert_txt(Alert), > > fbbf7a98975 (Ingela Anderton Andin 2017-08-31 18:31:06 +0200 2744) > error_logger:info_report(io_lib:format("~s ~p: In state ~p ~s\n", > [ProtocolName, Role, StateName, Txt])); > > fbbf7a98975 (Ingela Anderton Andin 2017-08-31 18:31:06 +0200 2745) > log_alert(true, Role, ProtocolName, StateName, Alert) -> > > 6c8a0271f75 (Ingela Anderton Andin 2016-08-12 12:17:47 +0200 2746) Txt = > ssl_alert:alert_txt(Alert), > > fbbf7a98975 (Ingela Anderton Andin 2017-08-31 18:31:06 +0200 2747) > error_logger:info_report(io_lib:format("~s ~p: In state ~p ~s\n", > [ProtocolName, Role, StateName, Txt])); > > fbbf7a98975 (Ingela Anderton Andin 2017-08-31 18:31:06 +0200 2748) > log_alert(false, _, _, _, _) -> > > 6c8a0271f75 (Ingela Anderton Andin 2016-08-12 12:17:47 +0200 2749) ok. > > > So this was not changed in the ssl application for OTP-21. > > In the master branch, we have started to use logger and the plan is that > log_alert true will be same as setting log level notice that is the default > log level. We have also added a debug level and possibility to set the > level. > > > Maybe there is something unforeseen in logger or logger/lager interaction? > > > Regards Ingela Erlang/OTP team- Ericsson AB > > > 2018-07-11 16:33 GMT+02:00 Roger Lipscombe : >> >> The report changed from 'error_logger:info_report' in OTP-20.x to >> 'error_logger:error_report' in OTP-21.x (and then to ?LOG_ERROR in >> master). >> >> This now results in a lot of noise in our error reporting, because we >> get "SSL: Socket error: etimedout #012" about 10 times a minute. >> >> Any chance this change could be reverted, please? >> >> Related: >> http://erlang.org/pipermail/erlang-questions/2016-December/091046.html >> >> Thanks, >> Roger. >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > From roger@REDACTED Wed Jul 11 19:31:03 2018 From: roger@REDACTED (Roger Lipscombe) Date: Wed, 11 Jul 2018 18:31:03 +0100 Subject: [erlang-questions] Logging level of "SSL: Socket error" In-Reply-To: References: Message-ID: Hi Ingela, On 11 July 2018 at 18:27, Roger Lipscombe wrote: > https://github.com/erlang/otp/blob/OTP-21.0/lib/ssl/src/ssl_connection.erl#L1341-L1342 > > Report = io_lib:format("SSL: Socket error: ~p ~n", [Reason]), > error_logger:error_report(Report), > (pressed send too quickly...) vs. https://github.com/erlang/otp/blob/OTP-20.3.2/lib/ssl/src/ssl_connection.erl#L1117-L1118 Report = io_lib:format("SSL: Socket error: ~p ~n", [Reason]), error_logger:info_report(Report), It changed in https://github.com/erlang/otp/commit/6e28a7909c665cc316d657dda02a2b8655ecc5da, but it's unclear whether it was deliberate or not. Thanks, Roger. From ingela.andin@REDACTED Wed Jul 11 22:04:05 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Wed, 11 Jul 2018 22:04:05 +0200 Subject: [erlang-questions] Logging level of "SSL: Socket error" In-Reply-To: References: Message-ID: Hi Roger! I see, those error loggings are not affected by the log_alert option as they are distribution logs and not TLS alert protocol logs. I agree the change might be accidental. We will have to review this. Regards Ingela Erlang/OTP team - Ericsson AB 2018-07-11 19:31 GMT+02:00 Roger Lipscombe : > Hi Ingela, > > On 11 July 2018 at 18:27, Roger Lipscombe wrote: > > https://github.com/erlang/otp/blob/OTP-21.0/lib/ssl/src/ssl_ > connection.erl#L1341-L1342 > > > > Report = io_lib:format("SSL: Socket error: ~p ~n", [Reason]), > > error_logger:error_report(Report), > > > > (pressed send too quickly...) > > vs. > > https://github.com/erlang/otp/blob/OTP-20.3.2/lib/ssl/src/ > ssl_connection.erl#L1117-L1118 > > Report = io_lib:format("SSL: Socket error: ~p ~n", [Reason]), > error_logger:info_report(Report), > > It changed in https://github.com/erlang/otp/commit/ > 6e28a7909c665cc316d657dda02a2b8655ecc5da, > but it's unclear whether it was deliberate or not. > > Thanks, > Roger. > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Thu Jul 12 00:03:14 2018 From: g@REDACTED (Guilherme Andrade) Date: Wed, 11 Jul 2018 23:03:14 +0100 Subject: [erlang-questions] [ANN] stacktrace_compat: get_stacktrace() compatibility on OTP 21 In-Reply-To: References: Message-ID: Hello list, Version 1.0.1 of stacktrace_compat, a workaround for the deprecation of erlang:get_stacktrace() on Erlang/OTP 21, has been released. Fixed: - unsafe use of stacktrace variables exported from previous try-catch blocks * Hex.pm package: https://hex.pm/packages/stacktrace_compat/1.0.1 * Change log: https://github.com/g-andrade/stacktrace_compat/blob/1.0.1/CHANGELOG.md -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From prakash.parmar@REDACTED Thu Jul 12 07:19:02 2018 From: prakash.parmar@REDACTED (Prakash Parmar) Date: Thu, 12 Jul 2018 05:19:02 +0000 Subject: [erlang-questions] Node Crash for inets config 'SocketType ssl' In-Reply-To: References: , Message-ID: Hello Ingela, I tweak rebar3 config to just load inets application rather than starting along with node using relx configuration {inets, load}. From node shell I have started ssl application and then inets application. But still I'm getting same Crash. Do you have any idea what might be wrong with it ? /Cheers, Prakash Parmar ________________________________ From: Ingela Andin Sent: Wednesday, July 11, 2018 5:05 PM To: Prakash Parmar Cc: Erlang Questions Subject: Re: [erlang-questions] Node Crash for inets config 'SocketType ssl' Hi! Well I am no rebar3 expert, but inets does not list ssl as a dependency as it is an "optional" dependency. You can check with application:which_applications() to see if it was started. Regards Ingela Erlang/OTP team - Ericsson AB 2018-07-11 7:12 GMT+02:00 Prakash Parmar >: Hello Ingela, Thanks for your response ?? I'm using rebar3 for release. I have mentioned ssl application in config file prior to inets application(though sequence doesn't matter) and as per my understanding rebar3 will take care of start sequence and I don't think so there is an option to define application start sequence explicitly. Am I right ? Let me know if there is any way to make sure to start ssl application before inets application. /Cheers, Prakash Parmar ________________________________ From: Ingela Andin > Sent: Tuesday, July 10, 2018 9:33:50 PM To: Prakash Parmar Cc: Erlang Questions Subject: Re: [erlang-questions] Node Crash for inets config 'SocketType ssl' Hi! Did you start the ssl application? Regards Ingela Erlang/OTP Team - Ericsson AB 2018-07-10 8:21 GMT+02:00 Prakash Parmar >: Hello, I have a web-server based on inets otp application and running completely fine over 'http' in order to support 'https' I have changed inets configuration as per the sample configuration located at Erlang's repo [1]. Here are the config file snippet I had changed/added, ... SocketType ssl SSLCertificateFile {{install_dir}}/config/www/certs/server.pem SSLCertificateKeyFile {{install_dir}}/config/www/certs/server.pem SSLVerifyClient 0 ... I have also generated certificate files[2] and kept it in above mentioned path. unfortunately node is crashing at startup and following logs is printed on shell. =CRASH REPORT==== 9-Jul-2018::12:13:50 === crasher: initial call: application_master:init/4 pid: <0.902.0> registered_name: [] exception exit: {{shutdown, {failed_to_start_child,httpd_sup, {shutdown, {failed_to_start_child, {httpd_instance_sup,any,8881,default}, {shutdown, {failed_to_start_child, {httpd_acceptor_sup,any,8881,default}, {shutdown, {failed_to_start_child, {httpd_acceptor_sup,any,8881,default}, {'EXIT', {function_clause, [{http_transport,start, [ssl], [{file,"http_transport.erl"},{line,54}]}, {httpd_acceptor,do_socket_start,1, [{file,"httpd_acceptor.erl"},{line,101}]}, {httpd_acceptor,do_init,4, [{file,"httpd_acceptor.erl"},{line,94}]}, {httpd_acceptor,acceptor_init,8, [{file,"httpd_acceptor.erl"},{line,82}]}, {proc_lib,init_p_do_apply,3, [{file,"proc_lib.erl"}, {line,247}]}]}}}}}}}}}}, {inets_app,start,[normal,[]]}} in function application_master:init/4 (application_master.erl, line 134) ancestors: [<0.901.0>] messages: [{'EXIT',<0.903.0>,normal}] links: [<0.901.0>,<0.739.0>] dictionary: [] trap_exit: true status: running heap_size: 987 stack_size: 27 reductions: 166 neighbours: Does anyone know what might be the problem ? I have looked into 'http_transport' module's code and it seems that start/1 function[3] is not accepting 'ssl' atom as an arity, Arity for this function is like {ssl, }. Any idea on this ? Did I missed anything ? / cheers, Prakash Parmar Reference, [1] https://github.com/erlang/otp/blob/master/lib/inets/examples/server_root/conf/ssl.conf https://github.com/erlang/otp/blob/master/lib/inets/examples/server_root/conf/httpd.conf [2] https://devcenter.heroku.com/articles/ssl-certificate-self https://stackoverflow.com/questions/991758/how-to-get-pem-file-from-key-and-crt-files [3] https://github.com/erlang/otp/blob/177a3470d598c892e0b7251cd2d9219aebcd3747/lib/inets/src/http_lib/http_transport.erl#L54 _______________________________________________ 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 Thu Jul 12 09:44:13 2018 From: eric.pailleau@REDACTED (PAILLEAU Eric) Date: Thu, 12 Jul 2018 09:44:13 +0200 Subject: [erlang-questions] [ANN] geas 2.2 (Erlang 21.0) Message-ID: <38961d7d-ce34-2ef2-02dc-8f222f159ed9@wanadoo.fr> Hi Geas 2.2 has been released ! Geas is a tool detecting the runnable official Erlang release window for your project. Geas will tell you also : - what are the offending functions in the beam/source files that reduce the available window. - if some beam files are compiled native. - the installed patches and recommend patches that should be installed depending your code. Geas is available as a module, erlang.mk and rebar 2/3 plugins. Changelog : - Update for Erlang 21.0 detection and database Note : as CORBA module(s) are moved from Erlang 'core', those are marked as removed from Geas database starting 21.0. This may change in future. https://github.com/crownedgrouse/geas https://github.com/crownedgrouse/geas/releases/tag/2.2 Cheers ! Eric From hello@REDACTED Thu Jul 12 10:07:19 2018 From: hello@REDACTED (Adam Lindberg) Date: Thu, 12 Jul 2018 10:07:19 +0200 Subject: [erlang-questions] erlang 21 In-Reply-To: References: <41381298.9HviYJOSeE@takoyaki> Message-ID: The proper solution here would be to support Ctrl+D as with most other interactive terminals out there: https://bugs.erlang.org/browse/ERL-331 Cheers, Adam > On 7. Jul 2018, at 13:03, Dmytro Lytovchenko wrote: > > I would say there is a clear usability flaw here. The shell should be smart enough to distinguish which command was typed (^G, ^C or q() or exit() or init:stop() or halt()) and whether there is a remote shell active. What it would do is to ask user what is his intent or somehow confirm that remote shell is active and REMOTE VM will now quit. > > If the shell isn't that smart, there's a great improvement waiting to happen. > > 2018-07-07 12:59 GMT+02:00 : > A quick anecdote... > > I and a lot of people on my team used to habitually halt() to exit. > > Then one day someone abruptly shut down a remote node they were connected > to because, well, they had that habit. > > ^G is a safer habit to form and reminds you where you are at when you hit > it, whether connected to a remote node from a local erl shell (want 'q'), > or via SSH (want 'exit()'). > > -Craig > _______________________________________________ > 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 -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP URL: From hello@REDACTED Thu Jul 12 10:24:48 2018 From: hello@REDACTED (Adam Lindberg) Date: Thu, 12 Jul 2018 10:24:48 +0200 Subject: [erlang-questions] io:format/1+2 in OTP 21 doesn't take iodat() anymore Message-ID: <68EB9EEA-E2E7-4BA9-B184-0B13860AD7C0@alind.io> Hi, Haven?t found any information anywhere in the changelogs about this, but there seems to be a ?regression? in the way io:format/1+2 works. It used to be possible to call it with a mixed IO list of binaries and strings (iodata()), but this is no longer possible: 14> io:format(["foo", "bar"]). foobarok 15> io:format([<<"foo">>, "bar"]). ** exception error: bad argument in function io:format/3 called as io:format(<0.63.0>,[<<"foo">>,"bar"],[]) It seems it was never documented, as the format was always 'atom() | string() | binary()', but in practice 'iodata()' was allowed. Is this change intentional or is it a bug? Cheers, Adam -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: Message signed with OpenPGP URL: From ingela.andin@REDACTED Thu Jul 12 10:46:20 2018 From: ingela.andin@REDACTED (Ingela Andin) Date: Thu, 12 Jul 2018 10:46:20 +0200 Subject: [erlang-questions] Node Crash for inets config 'SocketType ssl' In-Reply-To: References: Message-ID: HI Parmar! I see that you have a legacy apache like config file, you might want to try using a the documented config file format instead. Regards Ingela Erlang/OTP team - Ericsson AB 2018-07-12 7:19 GMT+02:00 Prakash Parmar : > Hello Ingela, > > > I tweak rebar3 config to just load inets application rather than starting > along with node using relx configuration {inets, load}. From node shell I > have started ssl application and then inets application. But still I'm > getting same Crash. Do you have any idea what might be wrong with it ? > > > /Cheers, > > Prakash Parmar > > ------------------------------ > *From:* Ingela Andin > *Sent:* Wednesday, July 11, 2018 5:05 PM > > *To:* Prakash Parmar > *Cc:* Erlang Questions > *Subject:* Re: [erlang-questions] Node Crash for inets config 'SocketType > ssl' > > Hi! > > Well I am no rebar3 expert, but inets does not list ssl as a dependency as > it is an "optional" dependency. You can check with application:which_applications() > to see if it was started. > > Regards Ingela Erlang/OTP team - Ericsson AB > > > 2018-07-11 7:12 GMT+02:00 Prakash Parmar : > > Hello Ingela, > > > Thanks for your response ?? > > > I'm using rebar3 for release. I have mentioned ssl application in config > file prior to inets application(though sequence doesn't matter) and as > per my understanding rebar3 will take care of start sequence and I don't > think so there is an option to define application start sequence > explicitly. Am I right ? > > > Let me know if there is any way to make sure to start ssl application > before inets application. > > > /Cheers, > > Prakash Parmar > > ------------------------------ > *From:* Ingela Andin > *Sent:* Tuesday, July 10, 2018 9:33:50 PM > *To:* Prakash Parmar > *Cc:* Erlang Questions > *Subject:* Re: [erlang-questions] Node Crash for inets config 'SocketType > ssl' > > Hi! > > Did you start the ssl application? > > Regards Ingela Erlang/OTP Team - Ericsson AB > > > > > 2018-07-10 8:21 GMT+02:00 Prakash Parmar : > > Hello, > > > I have a web-server based on inets otp application and running completely > fine over 'http' in order to support 'https' I have changed inets > configuration > > as per the sample configuration located at Erlang's repo [1]. > > > Here are the config file snippet I had changed/added, > > ... > SocketType ssl > SSLCertificateFile {{install_dir}}/config/www/certs/server.pem > SSLCertificateKeyFile {{install_dir}}/config/www/certs/server.pem > SSLVerifyClient 0 > ... > > I have also generated certificate files[2] and kept it in above mentioned > path. > > unfortunately node is crashing at startup and following logs is printed on > shell. > > =CRASH REPORT==== 9-Jul-2018::12:13:50 === > crasher: > initial call: application_master:init/4 > pid: <0.902.0> > registered_name: [] > exception exit: {{shutdown, > {failed_to_start_child,httpd_sup, > {shutdown, > {failed_to_start_child, > {httpd_instance_sup,any,8881,default}, > {shutdown, > {failed_to_start_child, > {httpd_acceptor_sup,any,8881,default}, > {shutdown, > {failed_to_start_child, > {httpd_acceptor_sup,any,8881,default}, > {'EXIT', > {function_clause, > [{http_transport,start, > [ssl], > [{file,"http_transport.erl"},{line,54}]}, > {httpd_acceptor,do_socket_start,1, > [{file,"httpd_acceptor.erl"}, > {line,101}]}, > {httpd_acceptor,do_init,4, > [{file,"httpd_acceptor.erl"},{line,94}]}, > {httpd_acceptor,acceptor_init,8, > [{file,"httpd_acceptor.erl"},{line,82}]}, > {proc_lib,init_p_do_apply,3, > [{file,"proc_lib.erl"}, > {line,247}]}]}}}}}}}}}}, > {inets_app,start,[normal,[]]}} > in function application_master:init/4 (application_master.erl, line > 134) > ancestors: [<0.901.0>] > messages: [{'EXIT',<0.903.0>,normal}] > links: [<0.901.0>,<0.739.0>] > dictionary: [] > trap_exit: true > status: running > heap_size: 987 > stack_size: 27 > reductions: 166 > neighbours: > > > > Does anyone know what might be the problem ? > > I have looked into 'http_transport' module's code and it seems that > start/1 function[3] is not accepting 'ssl' atom as an arity, > Arity for this function is like {ssl, }. Any idea > on this ? Did I missed anything ? > > / cheers, > Prakash Parmar > > > > Reference, > [1] https://github.com/erlang/otp/blob/master/lib/inets/exam > ples/server_root/conf/ssl.conf > https://github.com/erlang/otp/blob/master/lib/inets/example > s/server_root/conf/httpd.conf > > [2] https://devcenter.heroku.com/articles/ssl-certificate-self > https://stackoverflow.com/questions/991758/how-to-get-pem-f > ile-from-key-and-crt-files > > [3] https://github.com/erlang/otp/blob/177a3470d598c892e0b72 > 51cd2d9219aebcd3747/lib/inets/src/http_lib/http_transport.erl#L54 > > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From publicityifl@REDACTED Thu Jul 12 14:25:43 2018 From: publicityifl@REDACTED (Jurriaan Hage) Date: Thu, 12 Jul 2018 05:25:43 -0700 Subject: [erlang-questions] LAST CALL for draft papers for presentation at IFL 2018 (deadline this week) Message-ID: Hello, Please, find below the last call for draft papers for presentation for IFL 2018. Please forward these to anyone you think may be interested. Apologies for any duplicates you may receive. best regards, Jurriaan Hage Publicity Chair of IFL --- Call for Draft papers for presentations ============================================================ ==================== IFL 2018 30th Symposium on Implementation and Application of Functional Languages University of Massachusetts Lowell, MA, USA September 5th-7th, 2018 http://iflconference.org ============================================================ ==================== ### Scope The goal of the IFL symposia is to bring together researchers actively engaged in the implementation and application of functional and function-based programming languages. IFL 2018 will be a venue for researchers to present and discuss new ideas and concepts, work in progress, and publication-ripe results related to the implementation and application of functional languages and function-based programming. Topics of interest to IFL include, but are not limited to: - language concepts - type systems, type checking, type inferencing - compilation techniques - staged compilation - run-time function specialization - run-time code generation - partial evaluation - (abstract) interpretation - metaprogramming - generic programming - automatic program generation - array processing - concurrent/parallel programming - concurrent/parallel program execution - embedded systems - web applications - (embedded) domain specific languages - security - novel memory management techniques - run-time profiling performance measurements - debugging and tracing - virtual/abstract machine architectures - validation, verification of functional programs - tools and programming techniques - (industrial) applications ### Keynote Speakers * Adam Chlipala, Massachusetts Institute of Technology CSAIL * Arjun Guha, University of Massachusetts Amherst ### Submissions and peer-review Differently from previous editions of IFL, IFL 2018 solicits two kinds of submissions: * Regular papers (12 pages including references) * Draft papers for presentations ('weak' limit between 8 and 15 pages) Regular papers will undergo a rigorous review by the program committee, and will be evaluated according to their correctness, novelty, originality, relevance, significance, and clarity. A set of regular papers will be conditionally accepted for publication. Authors of conditionally accepted papers will be provided with committee reviews along with a set of mandatory revisions. Regular papers not accepted for publication will be considered as draft papers, at the request of the author. Draft papers will be screened to make sure that they are within the scope of IFL, and will be accepted for presentation or rejected accordingly. Prior to the symposium: Authors of conditionally accepted papers and accepted presentations will submit a pre-proceedings version of their work that will appear in the draft proceedings distributed at the symposium. The draft proceedings does not constitute a formal publication. We require that at least one of the authors present the work at IFL 2018. After the symposium: Authors of conditionally accepted papers will submit a revised versions of their paper for the formal post-proceedings. The program committee will assess whether the mandatory revisions have been adequately addressed by the authors and thereby determines the final accept/reject status of the paper. Our interest is to ultimately accept all conditionally accepted papers. If you are an author of a conditionally accepted paper, please make sure that you address all the concerns of the reviewers. Authors of accepted presentations will be given the opportunity to incorporate the feedback from discussions at the symposium and will be invited to submit a revised full article for the formal post-proceedings. The program committee will evaluate these submissions according to their correctness, novelty, originality, relevance, significance, and clarity, and will thereby determine whether the paper is accepted or rejected. ### Publication The formal proceedings will appear in the International Conference Proceedings Series of the ACM Digital Library. At no time may work submitted to IFL be simultaneously submitted to other venues; submissions must adhere to ACM SIGPLAN's republication policy: http://www.sigplan.org/Resources/Policies/Republication ### Important dates Submission of regular papers: May 25, 2018 [PASSED!] Submission of draft papers: July 17, 2018 [UPCOMING!] Regular and draft papers notification: July 20, 2018 Deadline for early registration: August 8, 2018 Submission of pre-proceedings version: August 29, 2018 IFL Symposium: September 5-7, 2018 Submission of papers for post-proceedings: November 7, 2018 Notification of acceptance: December 22, 2018 Camera-ready version: February 10, 2019 ### Submission details All contributions must be written in English. Papers must use the ACM two columns conference format, which can be found at: http://www.acm.org/publications/proceedings-template Authors submit through EasyChair: https://easychair.org/conferences/?conf=ifl2018 ### Peter Landin Prize The Peter Landin Prize is awarded to the best paper presented at the symposium every year. The honored article is selected by the program committee based on the submissions received for the formal review process. The prize carries a cash award equivalent to 150 Euros. ### Organization and Program committee Chairs: Jay McCarthy & Matteo Cimini, University of Massachusetts Lowell, USA Program Committee: * Arthur Chargueraud, Inria, FR * Ben Delaware, Purdue University, USA * Christos Dimoulas, Northwestern University, USA * David Darais, University of Vermont, USA * Dominic Orchard, University of Kent, UK * Ekaterina Komendantskaya, Heriot-Watt University, UK * Garrett Morris, University of Kansas, USA * Heather Miller, EPFL & Northeastern University, CH & USA * Jeremy Yallop, University of Cambridge, UK * Keiko Nakata, SAP Innovation Center Potsdam, DE * Laura Castro, University of A Coruna, ESP * Magnus Myreen, Chalmers University of Technology, SWE * Natalia Chechina, Bournemouth University, UK * Peter Achten, Radboud Universiteit Nijmegen, NL * Peter-Michael Osera, Grinnell College, USA * Richard Eisenberg, Bryn Mawr College, USA * Trevor McDonell, University of New South Wales, AUS * Yukiyoshi Kameyama, University of Tsukuba, JAP ### Venue The 30th IFL is organized by the University of Massachusetts Lowell. The City of Lowell is located at the heart of the Merrimack Valley just 30 miles northwest of Boston. Lowell can be easily reached by train or taxi. See the website for more information on the venue. ### Acknowledgments This call-for-papers is an adaptation and evolution of content from previous instances of IFL. We are grateful to prior organizers for their work, which is reused here. A part of IFL 2018 format and CFP language that describes conditionally accepted papers has been adapted from call-for-papers of OOPSLA conferences. -------------- next part -------------- An HTML attachment was scrubbed... URL: From codewiget95@REDACTED Thu Jul 12 22:35:54 2018 From: codewiget95@REDACTED (Code Wiget) Date: Thu, 12 Jul 2018 16:35:54 -0400 Subject: [erlang-questions] Issues with ets:match_delete Message-ID: Hey everyone, Lets say you have an ets table with entries as shown below: {table_name, key, {A, [B]}. I am trying to delete all table entries matching A. I can create a match like so: ets:match(table_name, {'_', '_', {Node, '$1'}}) and it returns the values for B. But when I run match_delete or select_delete, I get a badarg error?: > ets:match_delete(table_name, {'_', '_', {Node, '$1'}}). > ** exception error: bad argument > ? ? ?in function ?ets:select_delete/2 > ? ? ? ? called as ets:select_delete(table_name, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{{'_','_',{{{192,168,1,104},9042},'$1'}},[],[true]}]) > ? ? ?in call from ets:match_delete/2 (ets.erl, line 726) > (NODE)16> ets:select_delete(table_name, {'_', '_', {Node, '$1'}}). > ** exception error: bad argument > ? ? ?in function ?ets:select_delete/2 > ? ? ? ? called as ets:select_delete(table_name,{'_','_',{{{192,168,1,104},9042},'$1'}}) So I tried to match and object and delete it... > (NODE)17> ets:match_object(table_name, {'_', '_', {Node, '$1'}}). > [{table_name,'$primary_cluster', > ? ? ? ? ? ? ? ? Info?] > > > (NODE)25> ets:delete_object(table_name, Info). > ** exception error: bad argument > ? ? ?in function ?ets:delete_object/2 > ? ? ? ? called as ets:delete_object(table_name, ?. ) > I would like to avoid re-creating the table structure, as it is not from a project that I created and would take some time to fix all the code. How do I delete something from this table? Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From dane@REDACTED Thu Jul 12 23:48:15 2018 From: dane@REDACTED (Maxim Fedorov) Date: Thu, 12 Jul 2018 21:48:15 +0000 Subject: [erlang-questions] Debugging scheduler not responding to erts_schedule_misc_aux_work In-Reply-To: <1AF7EA97-AEFB-49CC-8ECC-22E7D0F3F0B8@whatsapp.com> References: <9B6C45BE-65C2-4DB1-8985-D7843ED7AB64@whatsapp.com> <1e549a8a2a9f3aa704bba2a1c6e32bff.squirrel@mail.alumni.caltech.edu> <1AF7EA97-AEFB-49CC-8ECC-22E7D0F3F0B8@whatsapp.com> Message-ID: <5ADE79CA-BC91-4A1F-9CE0-BB093C3C36D1@whatsapp.com> Confirming it's a different issue. I'm getting one scheduler stuck (waiting infinitely): Thread 80 (Thread 802010800 (LWP 100332/beam.smp)): #0 0x000000080136e13c in pthread_cleanup_pop () from /lib/libthr.so.3 #1 0x00000000005f664e in wait__ (e=0x84a801520, spincount=, timeout=) at pthread/ethr_event.c:468 #2 0x00000000004db9b1 in erts_schedule (esdp=, p=, calls=) at erl_threads.h:3406 #3 0x0000000000433cdc in process_main (x_reg_array=0x84d04edc0, f_reg_array=0x84d050e40) at beam/beam_emu.c:1349 #4 0x00000000004d4c4b in sched_thread_func (vesdp=0x84b413fc0) at beam/erl_process.c:8912 #5 0x00000000005f5fac in thr_wrapper (vtwd=0x7fffffffdb08) at pthread/ethread.c:118 #6 0x0000000801362855 in pthread_create () from /lib/libthr.so.3 #7 0x0000000000000000 in ?? () This happens when there are two outstanding requests: erlang:statistics(garbage_collection) erlang:statistics(scheduler_wall_time) Both of these are stuck waiting for a response from scheduler #28. --- Scheduler 28 --- IX: 27 CPU Binding: 27 Aux work Flags: delayed-dealloc-thr-prgr fix-alloc-dealloc fix-alloc-lower-lim async-ready GARBAGE Sleep Info Flags: Pointer: (ErtsSchedulerData *) 0x84b413fc0 - Run Queue - Length: total=1, max=0, high=0, normal=1, low=0, port=0 Misc Jobs: no Queue Mask: normal Misc Flags: out-of-work non-empty Pointer: (ErtsRunQueue *) 0x84aa4c280 Originally there was nothing in this scheduler queue, but I forcefully bound a process to it to see if scheduler is stuck on run queue lock (with process_flag(scheduler, 28)). So I guess it's a rare bug I eventually hit, which is different from a message being sent to exiting process. ?On 7/11/18, 09:30, "erlang-questions-bounces@REDACTED on behalf of Maxim Fedorov" wrote: Thanks, Anthony. This patch (and Erlang 20.3.8, ERTS 9.3.3.1) does not fix the problem. Same issue has been observed (2 servers out of 384 stopped responding to aux work). I believe it's a different issue. On 6/28/18, 18:14, "anthonym@REDACTED" wrote: It may or may not apply but we had a similar problem with system level work being scheduled on freed processes, and have been debugging it with Ericsson via https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.erlang.org_browse_ERL-2D573&d=DwIDaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=0rT1IQzTc-5vHQf8ht6-x-ib_QvAEDJvef2Q98CuKgI&m=To7mEUnu73Ram_9CzpEXWHPvoyDBDz5HDUpb2LyN8p0&s=-TFczFM6WlUROTl7JqcN8u6DmWN3djIS9xhIBlNWgJc&e= for the last few months. There's a branch of 20 in one of the later comments which might help, and might be worth a try. HTH, -Anthony > I?m trying to debug some weird condition when any misc system task hangs. > It seems to affect OTP 20 (but not 16) on FreeBSD 10.3 and 11. > > It is a rare problem happening after 5-7 days under some load (~40% cpu > average on a 48 cores server). > > There is also a problem with erlang:statistics(runtime), affected by this > bug in FreeBSD kernel: > https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freebsd.org_bugzilla_show-5Fbug.cgi-3Fid-3D227689&d=DwIDaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=0rT1IQzTc-5vHQf8ht6-x-ib_QvAEDJvef2Q98CuKgI&m=To7mEUnu73Ram_9CzpEXWHPvoyDBDz5HDUpb2LyN8p0&s=9ADTx_DQfyQVR8StEXx8AlI49seSh0G6lW-yqem4sIg&e= (so > statistics:runtime() always returns the same value), however I doubt it > can affect anything. > > What happens: there are several calls, e.g. > erlang:statistics(garbage_collection), ets:all(), > erts_internal:system_check() and few more. All of them do > erts_schedule_misc_aux_work. A misc aux work item is put into every > scheduler queue, and it seems that all of them except one respond. VM is > still working, all other processes are fine, but the one that did the call > is waiting in erlang:gc_info/2 (or another corresponding function), with > counter equals to 1. Since there is no timeout in receive statement, it > waits forever. > > How do I debug this? Is there any way to find a scheduler that misbehaves? > It is one of the normal schedulers. I?m using gdb to attach to BEAM VM. > > Unfortunately, I cannot run debug VM (it is not able to handle the load). > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > https://urldefense.proofpoint.com/v2/url?u=http-3A__erlang.org_mailman_listinfo_erlang-2Dquestions&d=DwIDaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=0rT1IQzTc-5vHQf8ht6-x-ib_QvAEDJvef2Q98CuKgI&m=To7mEUnu73Ram_9CzpEXWHPvoyDBDz5HDUpb2LyN8p0&s=v-L1XxeW7SHFxLJvBtf9oVk7FY7XgrzBtT7WvHaYEmw&e= > _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED https://urldefense.proofpoint.com/v2/url?u=http-3A__erlang.org_mailman_listinfo_erlang-2Dquestions&d=DwIGaQ&c=5VD0RTtNlTh3ycd41b3MUw&r=0rT1IQzTc-5vHQf8ht6-x-ib_QvAEDJvef2Q98CuKgI&m=TkZaL2U9Ds0ST7HzmI58OQK0wYrvAvxL1N1SHeqJeYM&s=tv2xgDzpD8TktqBUY7ayug-gYZ2k4ZTmkRnixU24lnY&e= From sverker.eriksson@REDACTED Fri Jul 13 13:24:37 2018 From: sverker.eriksson@REDACTED (Sverker Eriksson) Date: Fri, 13 Jul 2018 11:24:37 +0000 Subject: [erlang-questions] Issues with ets:match_delete In-Reply-To: References: Message-ID: <1531481076.13439.0.camel@ericsson.com> Your ets:match_delete looks fine. Are you sure the table is still alive? Try ets:info(table_name). When you get an exception in the Erlang shell, the shell process will terminate and be restarted losing all process specific resources such as ets tables. /Sverker, Erlang/OTP On tor, 2018-07-12 at 16:35 -0400, Code Wiget wrote: Hey everyone, Lets say you have an ets table with entries as shown below: {table_name, key, {A, [B]}. I am trying to delete all table entries matching A. I can create a match like so: ets:match(table_name, {'_', '_', {Node, '$1'}}) and it returns the values for B. But when I run match_delete or select_delete, I get a badarg error?: ets:match_delete(table_name, {'_', '_', {Node, '$1'}}). ** exception error: bad argument in function ets:select_delete/2 called as ets:select_delete(table_name, [{{'_','_',{{{192,168,1,104},9042},'$1'}},[],[true]}]) in call from ets:match_delete/2 (ets.erl, line 726) (NODE)16> ets:select_delete(table_name, {'_', '_', {Node, '$1'}}). ** exception error: bad argument in function ets:select_delete/2 called as ets:select_delete(table_name,{'_','_',{{{192,168,1,104},9042},'$1'}}) So I tried to match and object and delete it... (NODE)17> ets:match_object(table_name, {'_', '_', {Node, '$1'}}). [{table_name,'$primary_cluster', Info?] (NODE)25> ets:delete_object(table_name, Info). ** exception error: bad argument in function ets:delete_object/2 called as ets:delete_object(table_name, ?. ) I would like to avoid re-creating the table structure, as it is not from a project that I created and would take some time to fix all the code. How do I delete something from this table? Thanks! _______________________________________________ erlang-questions mailing list erlang-questions@REDACTED http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickard@REDACTED Fri Jul 13 13:40:36 2018 From: rickard@REDACTED (Rickard Green) Date: Fri, 13 Jul 2018 13:40:36 +0200 Subject: [erlang-questions] Patch package OTP 21.0.3 released Message-ID: <602efd23-efd4-de34-f2ce-f5dcf6130f08@erlang.org> Patch Package: OTP 21.0.3 Git Tag: OTP-21.0.3 Date: 2018-07-13 Trouble Report Id: OTP-15154, OTP-15183 Seq num: ERL-670 System: OTP Release: 21 Application: erts-10.0.3 Predecessor: OTP 21.0.2 Check out the git tag OTP-21.0.3, 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-10.0.3 ----------------------------------------------------- --------------------------------------------------------------------- The erts-10.0.3 application can be applied independently of other applications on a full OTP 21 installation. --- Fixed Bugs and Malfunctions --- OTP-15154 Application(s): erts Fixed a scheduler bug that caused normal schedulers to run dirty code. OTP-15183 Application(s): erts Related Id(s): ERL-670 Fixed a bug in erlang:trace_info/2 which caused the emulator to crash when a bad argument was passed. The bug was introduced in ERTS version 10.0. Full runtime dependencies of erts-10.0.3: kernel-6.0, sasl-3.0.1, stdlib-3.5 --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From essen@REDACTED Fri Jul 13 13:52:22 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Fri, 13 Jul 2018 13:52:22 +0200 Subject: [erlang-questions] Patch package OTP 21.0.3 released In-Reply-To: <602efd23-efd4-de34-f2ce-f5dcf6130f08@erlang.org> References: <602efd23-efd4-de34-f2ce-f5dcf6130f08@erlang.org> Message-ID: Hello, http://erlang.org/download/OTP-21.0.3.README also has the following note that's missing from the email announcement: --------------------------------------------------------------------- --- otp-21.0.3 ------------------------------------------------------ --------------------------------------------------------------------- --- Improvements and New Features --- OTP-15176 Application(s): otp Related Id(s): ERIERL-198, ERIERL-202, ERL-640, OTP-14283, OTP-15177 Build support for the erlang/corba repository. On 07/13/2018 01:40 PM, Rickard Green wrote: > Patch Package:?????????? OTP 21.0.3 > Git Tag:???????????????? OTP-21.0.3 > Date:??????????????????? 2018-07-13 > Trouble Report Id:?????? OTP-15154, OTP-15183 > Seq num:???????????????? ERL-670 > System:????????????????? OTP > Release:???????????????? 21 > Application:???????????? erts-10.0.3 > Predecessor:???????????? OTP 21.0.2 > > ?Check out the git tag OTP-21.0.3, 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-10.0.3 ----------------------------------------------------- > ?--------------------------------------------------------------------- > > ?The erts-10.0.3 application can be applied independently of other > ?applications on a full OTP 21 installation. > > ?--- Fixed Bugs and Malfunctions --- > > ? OTP-15154??? Application(s): erts > > ?????????????? Fixed a scheduler bug that caused normal schedulers to > ?????????????? run dirty code. > > > ? OTP-15183??? Application(s): erts > ?????????????? Related Id(s): ERL-670 > > ?????????????? Fixed a bug in erlang:trace_info/2 which caused the > ?????????????? emulator to crash when a bad argument was passed. The > ?????????????? bug was introduced in ERTS version 10.0. > > > ?Full runtime dependencies of erts-10.0.3: kernel-6.0, sasl-3.0.1, > ?stdlib-3.5 > > > ?--------------------------------------------------------------------- > ?--------------------------------------------------------------------- > ?--------------------------------------------------------------------- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- Lo?c Hoguin https://ninenines.eu From erlangsiri@REDACTED Fri Jul 13 14:22:50 2018 From: erlangsiri@REDACTED (Siri Hansen) Date: Fri, 13 Jul 2018 14:22:50 +0200 Subject: [erlang-questions] Node not responding to init:stop() In-Reply-To: References: Message-ID: For information: After some off-list trouble shooting we found the reason for this issue to be a dead-lock in error_logger and the logger_sup supervisor. A correction is merged to maint and master today. Regards /siri Den tir. 3. jul. 2018 kl. 13:48 skrev Roger Lipscombe < roger@REDACTED>: > Note that I can reproduce this consistently, so if there's any > experimentation (tracing, patches, etc.) you want me to try, I should > be able to do that. > > On 3 July 2018 at 12:45, Roger Lipscombe wrote: > > Before I go looking for permission to release the crash dump (it'll > > take at least a couple of hours; I'll ask), let's see what we can > > figure out from here. > > > > There are 44 processes alive. Most of them look fairly innocuous, but, > > in terms of logger, I see: > > > > - A process <0.2130.0> sitting in erlang:apply, issuing > > error_logger:stop, which is a gen_server:call, timeout infinity, to > > <0.927.0>. Stack is logger_server:'-call_h_async/4-fun-0-'/2 + 152 -> > > logger_server:call_h/4 + 96 -> error_logger:removing_handler/1 + 112 > > -> error_logger:stop/0 + 72 > > - <0.927.0> is 'logger_sup'; it appears to be trying to call > > <0.890.0>, which is 'logger'. > > - <0.890.0> is, apparently, sitting in proc_lib:init_p_do_apply/3 > > > > I suspect that logger_sup has failed in supervisor:do_terminate, and > > is attempting to report an error, via logger (which is problematic, I > > guess). I see the following on the logger_sup stack: > > > > #{level => error, > > meta => > > #{domain => [otp,sasl], > > error_logger => #{tag => error_report,type => supervisor_report}, > > file => "supervisor.erl", > > gl => <0.894.0>, > > line => 838, > > logger_formatter => #{title => "SUPERVISOR REPORT"}, > > mfa => {supervisor,do_terminate,2}, > > pid => <0.927.0>, > > report_cb => fun logger:format_otp_report/1,time => > 1530616282326266}, > > msg => > > {report,#{label => {supervisor,shutdown_error}, > > report => > > [{supervisor,{local,logger_sup}}, > > {errorContext,shutdown_error}, > > {reason,killed}, > > {offender,[{pid,<0.929.0>}, > > {id,default}, > > > {mfargs,{logger_std_h,start_link,undefined}}, > > {restart_type,temporary}, > > {shutdown,2000}, > > {child_type,worker}]}]}}} > > > > At this point, logger_sup has zero links, is monitoring 'logger' and > > is monitored by kernel_sup and the process that's calling > > error_logger:stop. > > > > For a *running* node, I get: > > > > 1> supervisor:which_children(logger_sup). > > [{error_logger,<0.1023.0>,worker,dynamic}, > > {default,<0.929.0>,worker,[logger_std_h]}] > > > > Assuming that the low process IDs are relatively stable, that > > <0.929.0> for the default logger correlates with the offender in the > > ?reportError above. > > > > I *believe* that lager's running independently. That is: I've done > > nothing deliberate to connect the two. I'm using lager 3.6.3. > > > > Thanks, > > Roger. > > > > On 3 July 2018 at 11:32, Siri Hansen wrote: > >> Hi Roger, > >> > >> there's been a few changes in the shutdown procedure (init.erl) with the > >> introduction of Logger in OTP-21. There are also some changes in the > >> supervision tree of the Kernel application related to Logger. I don't > know > >> if this has anything to do with your problem, but the chances exist, of > >> course. > >> > >> As you say, Kernel is the last application to be taken down (it's the > last > >> element in the #state.running of application_controller), and the state > you > >> see is probably stale in the sense that all applications listed before > >> kernel in the 'running' list should already have been terminated. From > the > >> crash dump - can you see how many processes are still alive? Are they > all > >> part of kernel, or are there more applications that did not completely > >> terminate? > >> > >> And if we are to look closer at the logger track - do you know which > logger > >> handlers were active? Are there any children under the logger_sup > >> supervisor, and if so, what are their state? You mention lager above, > do you > >> know how lager and logger are connected (is lager a handler under > logger, or > >> does it run independently)? > >> > >> If you see anything suspicious related to logger, please feel free to > send > >> me the crash dump off-list, and I'll see if I can figure out anything > more. > >> > >> Regards > >> /siri > >> > >> > >> > >> Den man. 2. jul. 2018 kl. 18:24 skrev Roger Lipscombe > >> : > >>> > >>> Right, so I've done some digging. I got a crash dump and by looking at > >>> the stack trace for application_controller, I can see that it's > >>> hanging in application_controller:terminate, presumably while waiting > >>> for one of the processes to stop. The pid given is <0.893.0>. Looking > >>> a bit further up the stack trace gets me the process state (possibly > >>> stale?), which contains a bunch of applications and pids. The pid it's > >>> hanging on is 'kernel', which I'd expect to be the last (?) > >>> application to be shut down. The process state (assuming it's not > >>> stale) has a load of other applications in there with pids. There are > >>> a bunch of ours, but also others, such as runtime_tools, cowboy, > >>> amqp_client, hackney, lager, etc. > >>> > >>> Is any of this useful in finding out why it's hanging? > >>> > >>> On 2 July 2018 at 16:54, Roger Lipscombe > wrote: > >>> > This sounds similar to > >>> > > http://erlang.org/pipermail/erlang-questions/2012-December/071223.html, > >>> > but it's not quite the same, as far as I can tell. > >>> > > >>> > I've noticed that, at some point since upgrading from OTP-20.3 to > >>> > OTP-21.0 (along with the necessary dependency updates), my Erlang > >>> > nodes are no longer stopping at the end of our system test run. > >>> > > >>> > The nodes are orchestrated by having 'erlexec' run a bash script > which > >>> > uses (effectively) 'foo/bin/foo foreground &'. I'm relying on erlexec > >>> > killing the bash script and that killing the nodes. This works fine > >>> > when the nodes are using OTP-20.3, but not with OTP-21.0. > >>> > > >>> > If I connect to the node, I can issue 'init:stop()', and it returns > >>> > ok, but nothing happens. If I use 'application:which_applications()', > >>> > I get a timeout. > >>> > > >>> > Unlike the linked discussion, I _can_ repeatedly connect a remote > >>> > shell (using erl -remsh), but I have to resort to erlang:halt() to > >>> > stop the node. Since my system test environment relies on orderly > >>> > process group teardown to stop the nodes, that's not useful. > >>> > > >>> > As I understand it, process group teardown results in SIGTERM, which > >>> > results in a call to init:stop, which should stop the node. It isn't. > >>> > > >>> > How do I figure out why init:stop() isn't working? > >>> _______________________________________________ > >>> erlang-questions mailing list > >>> erlang-questions@REDACTED > >>> http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Fri Jul 13 15:33:07 2018 From: lukas@REDACTED (Lukas Larsson) Date: Fri, 13 Jul 2018 15:33:07 +0200 Subject: [erlang-questions] net_kernel:start without writing cookie file? In-Reply-To: References: Message-ID: Hello, On Tue, Jul 10, 2018 at 5:13 PM Roger Lipscombe wrote: > When you start distribution with (e.g.) net_kernel:start([foo, > shortnames]), Erlang writes ~/.erlang.cookie as the current user, with > mode 600. > > If you inadvertently use sudo to run your escript, it creates the > .erlang.cookie file owned by root. The next time you run your escript > without sudo (because it wasn't needed), Erlang dies with a > scary-looking error message. > > Since our particular escript immediately calls erlang:set_cookie, it's > kinda pointless generating the cookie file. > > Is there any way to disable this behaviour, so that people who > accidentally use 'sudo' don't get caught out? > There is an undocumented option called "-nocookie" that seems to do what you want. However if you want to use a documented way, doesn't it work to just set a static cookie in the escript and then change it later on? i.e. %%! -setcookie nocookie main(_) -> net_kernel:start([foo,shortnames]), erlang:set_cookie(node(),secret). Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickard@REDACTED Fri Jul 13 15:56:19 2018 From: rickard@REDACTED (Rickard Green) Date: Fri, 13 Jul 2018 15:56:19 +0200 Subject: [erlang-questions] Patch package OTP 21.0.3 released In-Reply-To: References: <602efd23-efd4-de34-f2ce-f5dcf6130f08@erlang.org> Message-ID: Thanks! For some reason our patch script removed the OTP-15176 release note so I had to put it in manually. Then it got lost in the mail... :-( Regards, Rickard On 2018-07-13 13:52, Lo?c Hoguin wrote: > Hello, > > http://erlang.org/download/OTP-21.0.3.README also has the following note > that's missing from the email announcement: > > ?--------------------------------------------------------------------- > ?--- otp-21.0.3 ------------------------------------------------------ > ?--------------------------------------------------------------------- > > ?--- Improvements and New Features --- > > ? OTP-15176??? Application(s): otp > ?????????????? Related Id(s): ERIERL-198, ERIERL-202, ERL-640, > ?????????????? OTP-14283, OTP-15177 > > ?????????????? Build support for the erlang/corba repository. > > On 07/13/2018 01:40 PM, Rickard Green wrote: >> Patch Package:?????????? OTP 21.0.3 >> Git Tag:???????????????? OTP-21.0.3 >> Date:??????????????????? 2018-07-13 >> Trouble Report Id:?????? OTP-15154, OTP-15183 >> Seq num:???????????????? ERL-670 >> System:????????????????? OTP >> Release:???????????????? 21 >> Application:???????????? erts-10.0.3 >> Predecessor:???????????? OTP 21.0.2 >> >> ??Check out the git tag OTP-21.0.3, 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-10.0.3 ----------------------------------------------------- >> ??--------------------------------------------------------------------- >> >> ??The erts-10.0.3 application can be applied independently of other >> ??applications on a full OTP 21 installation. >> >> ??--- Fixed Bugs and Malfunctions --- >> >> ?? OTP-15154??? Application(s): erts >> >> ??????????????? Fixed a scheduler bug that caused normal schedulers to >> ??????????????? run dirty code. >> >> >> ?? OTP-15183??? Application(s): erts >> ??????????????? Related Id(s): ERL-670 >> >> ??????????????? Fixed a bug in erlang:trace_info/2 which caused the >> ??????????????? emulator to crash when a bad argument was passed. The >> ??????????????? bug was introduced in ERTS version 10.0. >> >> >> ??Full runtime dependencies of erts-10.0.3: kernel-6.0, sasl-3.0.1, >> ??stdlib-3.5 >> >> >> ??--------------------------------------------------------------------- >> ??--------------------------------------------------------------------- >> ??--------------------------------------------------------------------- >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > From rickard@REDACTED Fri Jul 13 16:09:28 2018 From: rickard@REDACTED (Rickard Green) Date: Fri, 13 Jul 2018 16:09:28 +0200 Subject: [erlang-questions] Patch Package CORBA 4.5.1 Released Message-ID: Patch Package: CORBA 4.5.1 Git Tag: 4.5.1 Date: 2018-07-13 Trouble Report Id: OTP-15023, OTP-15176, OTP-15179 Seq num: ERIERL-150, ERIERL-198, ERIERL-202, ERL-640, ERIERL-208 System: CORBA Application: corba-4.5.1 Predecessor: CORBA 4.5 --------------------------------------------------------------------- --- corba-4.5.1 ----------------------------------------------------- --------------------------------------------------------------------- --- Fixed Bugs and Malfunctions --- OTP-15023 Related Id(s): ERIERL-150 Optimize encoding/decoding for pure 7-bit ascii atoms in IC. OTP-15176 Related Id(s): OTP-14283, OTP-15176, ERIERL-198, ERIERL-202, ERL-640 Fixed various build issues. Note that you need to build the corba repo against an OTP of at least version 21.0.3. See the README.md file for updated build instructions. OTP-15179 Related Id(s): ERIERL-208 Fixed potential buffer overflow bugs in IC oe_ei_encode_long/ulong/longlong/ulonglong functions on 64-bit architectures. These functions expect 32 bit integers as the IDL type "long" is defined as 32 bits. But there is nothing preventing user code from "breaking" the interface and pass larger values on 64-bit architectures where the C type "long" is 64 bits. --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From codewiget95@REDACTED Fri Jul 13 17:01:59 2018 From: codewiget95@REDACTED (Code Wiget) Date: Fri, 13 Jul 2018 11:01:59 -0400 Subject: [erlang-questions] Issues with ets:match_delete In-Reply-To: <1531481076.13439.0.camel@ericsson.com> References: <1531481076.13439.0.camel@ericsson.com> Message-ID: <5ed95165-ee29-4295-9137-117f01e5cf95@Spark> Here, it seems alive (NODE13> ets:info(table_name). [{read_concurrency,true}, ?{write_concurrency,false}, ?{compressed,false}, ?{memory,422}, ?{owner,<0.1064.0>}, ?{heir,none}, ?{name,cqerl_clusters}, ?{size,2}, ?{node,?NODE'}, ?{named_table,true}, ?{type,bag}, ?{keypos,2}, ?{protection,protected}] On Jul 13, 2018, 7:24 AM -0400, Sverker Eriksson , wrote: > Your ets:match_delete looks fine. > Are you sure the table is still alive? Try ets:info(table_name). > > When you get an exception in the Erlang shell, the shell process will terminate and be restarted > losing all process specific resources such as ets tables. > > > /Sverker, Erlang/OTP > > > On tor, 2018-07-12 at 16:35 -0400, Code Wiget wrote: > > Hey everyone, > > > > Lets say you have an ets table with entries as shown below: > > > > {table_name, key, {A, [B]}. > > > > I am trying to delete all table entries matching A. I can create a match like so: > > > > ets:match(table_name, {'_', '_', {Node, '$1'}}) > > > > and it returns the values for B. But when I run match_delete or select_delete, I get a badarg error?: > > > > > ets:match_delete(table_name, {'_', '_', {Node, '$1'}}). > > > ** exception error: bad argument > > > ? ? ?in function ?ets:select_delete/2 > > > ? ? ? ? called as ets:select_delete(table_name, > > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{{'_','_',{{{192,168,1,104},9042},'$1'}},[],[true]}]) > > > ? ? ?in call from ets:match_delete/2 (ets.erl, line 726) > > > (NODE)16> ets:select_delete(table_name, {'_', '_', {Node, '$1'}}). > > > ** exception error: bad argument > > > ? ? ?in function ?ets:select_delete/2 > > > ? ? ? ? called as ets:select_delete(table_name,{'_','_',{{{192,168,1,104},9042},'$1'}}) > > > > So I tried to match and object and delete it... > > > > > (NODE)17> ets:match_object(table_name, {'_', '_', {Node, '$1'}}). > > > [{table_name,'$primary_cluster', > > > ? ? ? ? ? ? ? ? Info?] > > > > > > > > > (NODE)25> ets:delete_object(table_name, Info). > > > ** exception error: bad argument > > > ? ? ?in function ?ets:delete_object/2 > > > ? ? ? ? called as ets:delete_object(table_name, ?. ) > > > > > I would like to avoid re-creating the table structure, as it is not from a project that I created and would take some time to fix all the code. How do I delete something from this table? > > > > 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 codewiget95@REDACTED Fri Jul 13 17:05:27 2018 From: codewiget95@REDACTED (Code Wiget) Date: Fri, 13 Jul 2018 11:05:27 -0400 Subject: [erlang-questions] Issues with ets:match_delete In-Reply-To: <5ed95165-ee29-4295-9137-117f01e5cf95@Spark> References: <1531481076.13439.0.camel@ericsson.com> <5ed95165-ee29-4295-9137-117f01e5cf95@Spark> Message-ID: Here is a full run of it. I am working on the open source project cqerl: (NODE)19> [Test] = ets:match_object(cqerl_clusters, {'_', '_', {Node, '$1'}}). [{cluster_table,'$primary_cluster', ? ? ? ? ? ? ? ? {{{192,168,1,104},9042}, ? ? ? ? ? ? ? ? ?[{cassandra_nodes,[{<<"192.168.1.107">>,9042}, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {<<"192.168.1.104">>,9042}]}, ? ? ? ? ? ? ? ? ? {keyspace,devices}, ? ? ? ? ? ? ? ? ? {included_applications,[]}, ? ? ? ? ? ? ? ? ? {reconnect_interval,12}]}}] (NODE)20> ets:delete_object(cqerl_clusters, Test). ** exception error: bad argument ? ? ?in function ?ets:delete_object/2 ? ? ? ? called as ets:delete_object(cqerl_clusters, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {cluster_table,'$primary_cluster', ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{{{192,168,1,104},9042}, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{cassandra_nodes,[{<<"192.168.1.107">>,9042}, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{<<"192.168.1.104">>,9042}]}, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{keyspace,devices}, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{included_applications,[]}, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{reconnect_interval,12}]}}) (NODE)21> ets:delete_object(cqerl_clusters, [Test]). ** exception error: bad argument ? ? ?in function ?ets:delete_object/2 ? ? ? ? called as ets:delete_object(cqerl_clusters, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{cluster_table,'$primary_cluster', ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {{{192,168,1,104},9042}, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?[{cassandra_nodes,[{<<"192.168.1.107">>,9042}, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {<<"192.168.1.104">>,9042}]}, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {keyspace,devices}, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {included_applications,[]}, ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {reconnect_interval,12}]}}]) Cant figure why the match is working but not the delete.. On Jul 13, 2018, 11:01 AM -0400, Code Wiget , wrote: > Here, it seems alive > > (NODE13> ets:info(table_name). > [{read_concurrency,true}, > ?{write_concurrency,false}, > ?{compressed,false}, > ?{memory,422}, > ?{owner,<0.1064.0>}, > ?{heir,none}, > ?{name,cqerl_clusters}, > ?{size,2}, > ?{node,?NODE'}, > ?{named_table,true}, > ?{type,bag}, > ?{keypos,2}, > ?{protection,protected}] > > > On Jul 13, 2018, 7:24 AM -0400, Sverker Eriksson , wrote: > > Your ets:match_delete looks fine. > > Are you sure the table is still alive? Try ets:info(table_name). > > > > When you get an exception in the Erlang shell, the shell process will terminate and be restarted > > losing all process specific resources such as ets tables. > > > > > > /Sverker, Erlang/OTP > > > > > > On tor, 2018-07-12 at 16:35 -0400, Code Wiget wrote: > > > Hey everyone, > > > > > > Lets say you have an ets table with entries as shown below: > > > > > > {table_name, key, {A, [B]}. > > > > > > I am trying to delete all table entries matching A. I can create a match like so: > > > > > > ets:match(table_name, {'_', '_', {Node, '$1'}}) > > > > > > and it returns the values for B. But when I run match_delete or select_delete, I get a badarg error?: > > > > > > > ets:match_delete(table_name, {'_', '_', {Node, '$1'}}). > > > > ** exception error: bad argument > > > > ? ? ?in function ?ets:select_delete/2 > > > > ? ? ? ? called as ets:select_delete(table_name, > > > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{{'_','_',{{{192,168,1,104},9042},'$1'}},[],[true]}]) > > > > ? ? ?in call from ets:match_delete/2 (ets.erl, line 726) > > > > (NODE)16> ets:select_delete(table_name, {'_', '_', {Node, '$1'}}). > > > > ** exception error: bad argument > > > > ? ? ?in function ?ets:select_delete/2 > > > > ? ? ? ? called as ets:select_delete(table_name,{'_','_',{{{192,168,1,104},9042},'$1'}}) > > > > > > So I tried to match and object and delete it... > > > > > > > (NODE)17> ets:match_object(table_name, {'_', '_', {Node, '$1'}}). > > > > [{table_name,'$primary_cluster', > > > > ? ? ? ? ? ? ? ? Info?] > > > > > > > > > > > > (NODE)25> ets:delete_object(table_name, Info). > > > > ** exception error: bad argument > > > > ? ? ?in function ?ets:delete_object/2 > > > > ? ? ? ? called as ets:delete_object(table_name, ?. ) > > > > > > > I would like to avoid re-creating the table structure, as it is not from a project that I created and would take some time to fix all the code. How do I delete something from this table? > > > > > > 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 s.ledenev@REDACTED Fri Jul 13 15:25:56 2018 From: s.ledenev@REDACTED (Stanislav Ledenev) Date: Fri, 13 Jul 2018 16:25:56 +0300 Subject: [erlang-questions] Filtering hierarchical data structure In-Reply-To: References: Message-ID: Hello, I am new to Erlang and functional programming (1-1.5 months) and have task: 1. Suppose we have hierarchical tree-like data structure: L = [ {section, "id1", [ {section, "id1.1", [ {policy, "p1", "v1"}, {policy, "p2", "v2"} ]}, {section, "id1.2", [ ]} ]}, {section, "id2", [ {policy, "p3", "v3"} ] }, {section, "id3", [ ] } ] 2. List of some "section"'s with children elements any of which could be another "section" with children or "policy" with name and value. 3. Also we have another list which contains identifiers of policies: F = ["p1", "p3"]. 4. Now I need to write a function which takes lists L, F and returns list L2 such as L2 contains only those "section"'s which has "policies" wich Id equals to those in F. Empty sections must be removed. For lists L and F result should be: L2 = [ {section, "id1", [ {section, "id1.1", [ {policy, "p1", "v1"}, ]}, ]}, {section, "id2", [ {policy, "p3", "v3"} ] }, ] 5. I have solution (please see below) but it seems to me not as good as it can be and even little weird. I am sure that it could be improved and done in proper way. If anyone could give me any glimpse or advice I would appreciate. Source: --------------------------------------------------------------------------- main() -> L = [ {section, "id1", [ {section, "id1.1", [ {policy, "p1", "v1"}, {policy, "p2", "v2"} ]}, {section, "id1.2", [ ]} ]}, {section, "id2", [ {policy, "p3", "v3"} ] }, {section, "id3", [ ] } ], %filter(L, ["p1", "p3"]). filter(L, ["p3"]). filter([H | T], Search) -> lists:flatten([filter(H, Search, []) | filter(T, Search, [])]). filter({section, I, C}, Search, _Acc) -> NewC = filter(C, Search, []), case NewC of [] -> []; _ -> {section, I, NewC} end; filter([{section, I, C} | T], Search, Acc) -> NewC = filter(C, Search, []), case NewC of [] -> filter(T, Search, Acc); _ -> filter(T, Search, [{section, I, NewC} | Acc]) end; filter([{policy, I, V} | T], Search, Acc) -> case lists:member(I, Search) of true -> filter(T, Search, [{policy, I, V} | Acc]); false -> filter(T, Search, Acc) end; filter([], _S, Acc) -> Acc. -- Stanislav Ledenev -------------- next part -------------- An HTML attachment was scrubbed... URL: From sverker@REDACTED Fri Jul 13 17:44:17 2018 From: sverker@REDACTED (Sverker Eriksson) Date: Fri, 13 Jul 2018 17:44:17 +0200 Subject: [erlang-questions] Issues with ets:match_delete In-Reply-To: References: <1531481076.13439.0.camel@ericsson.com> <5ed95165-ee29-4295-9137-117f01e5cf95@Spark> Message-ID: <1531496657.13439.8.camel@erlang.org> The table is 'protected', meaning only the owner?<0.1064.0> can write to it. /Sverker On fre, 2018-07-13 at 11:05 -0400, Code Wiget wrote: > Here is a full run of it. I am working on the open source project cqerl: > > (NODE)19> [Test] = ets:match_object(cqerl_clusters, {'_', '_', {Node, '$1'}}). > [{cluster_table,'$primary_cluster', > ? ? ? ? ? ? ? ? {{{192,168,1,104},9042}, > ? ? ? ? ? ? ? ? ?[{cassandra_nodes,[{<<"192.168.1.107">>,9042}, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {<<"192.168.1.104">>,9042}]}, > ? ? ? ? ? ? ? ? ? {keyspace,devices}, > ? ? ? ? ? ? ? ? ? {included_applications,[]}, > ? ? ? ? ? ? ? ? ? {reconnect_interval,12}]}}] > (NODE)20> ets:delete_object(cqerl_clusters, Test). ? ? ? ? ? ? ? ? ? ? ? ? ? ? > ** exception error: bad argument > ? ? ?in function ?ets:delete_object/2 > ? ? ? ? called as ets:delete_object(cqerl_clusters, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {cluster_table,'$primary_cluster', > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{{{192,168,1,104},9042}, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? > [{cassandra_nodes,[{<<"192.168.1.107">>,9042}, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? > ?{<<"192.168.1.104">>,9042}]}, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{keyspace,devices}, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? > ?{included_applications,[]}, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? > ?{reconnect_interval,12}]}}) > (NODE)21> ets:delete_object(cqerl_clusters, [Test]). > ** exception error: bad argument > ? ? ?in function ?ets:delete_object/2 > ? ? ? ? called as ets:delete_object(cqerl_clusters, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{cluster_table,'$primary_cluster', > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {{{192,168,1,104},9042}, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? > ?[{cassandra_nodes,[{<<"192.168.1.107">>,9042}, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? > {<<"192.168.1.104">>,9042}]}, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {keyspace,devices}, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? > {included_applications,[]}, > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? > {reconnect_interval,12}]}}]) > > Cant figure why the match is working but not the delete.. > > On Jul 13, 2018, 11:01 AM -0400, Code Wiget , wrote: > > Here, it seems alive > > > > (NODE13> ets:info(table_name). > > [{read_concurrency,true}, > > ?{write_concurrency,false}, > > ?{compressed,false}, > > ?{memory,422}, > > ?{owner,<0.1064.0>}, > > ?{heir,none}, > > ?{name,cqerl_clusters}, > > ?{size,2}, > > ?{node,?NODE'}, > > ?{named_table,true}, > > ?{type,bag}, > > ?{keypos,2}, > > ?{protection,protected}] > > > > > > On Jul 13, 2018, 7:24 AM -0400, Sverker Eriksson > > com>, wrote: > > > Your ets:match_delete looks fine. > > > Are you sure the table is still alive? Try ets:info(table_name). > > > > > > When you get an exception in the Erlang shell, the shell process will > > > terminate and be restarted > > > losing all process specific resources such as ets tables. > > > > > > > > > /Sverker, Erlang/OTP > > > > > > > > > On tor, 2018-07-12 at 16:35 -0400, Code Wiget wrote: > > > > Hey everyone, > > > > > > > > Lets say you have an ets table with entries as shown below: > > > > > > > > {table_name, key, {A, [B]}.? > > > > > > > > I am trying to delete all table entries matching A. I can create a match > > > > like so: > > > > > > > > ets:match(table_name, {'_', '_', {Node, '$1'}})? > > > > > > > > and it returns the values for B. But when I run match_delete or > > > > select_delete, I get a badarg error?: > > > > > > > > ets:match_delete(table_name, {'_', '_', {Node, '$1'}}). > > > > ** exception error: bad argument > > > > ? ? ?in function ?ets:select_delete/2 > > > > ? ? ? ? called as ets:select_delete(table_name, > > > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? > > > > [{{'_','_',{{{192,168,1,104},9042},'$1'}},[],[true]}]) > > > > ? ? ?in call from ets:match_delete/2 (ets.erl, line 726) > > > > (NODE)16> ets:select_delete(table_name, {'_', '_', {Node, '$1'}}). > > > > ** exception error: bad argument > > > > ? ? ?in function ?ets:select_delete/2 > > > > ? ? ? ? called as > > > > ets:select_delete(table_name,{'_','_',{{{192,168,1,104},9042},'$1'}}) > > > > > > > > So I tried to match and object and delete it... > > > > > > > > (NODE)17> ets:match_object(table_name, {'_', '_', {Node, '$1'}}).? > > > > [{table_name,'$primary_cluster', > > > > ? ? ? ? ? ? ? ? Info?] > > > > > > > > > > > > (NODE)25> ets:delete_object(table_name, Info). ? ? ? ? ? ? ? ? ? ? ? ? ? > > > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? > > > > ** exception error: bad argument > > > > ? ? ?in function ?ets:delete_object/2 > > > > ? ? ? ? called as ets:delete_object(table_name, ?. ) > > > > > > > > I would like to avoid re-creating the table structure, as it is not from > > > > a project that I created and would take some time to fix all the code. > > > > How do I delete something from this table? > > > > > > > > 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 > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Fri Jul 13 18:06:45 2018 From: lukas@REDACTED (Lukas Larsson) Date: Fri, 13 Jul 2018 18:06:45 +0200 Subject: [erlang-questions] erlang 21 In-Reply-To: References: Message-ID: Hello, On Sat, Jul 7, 2018 at 1:48 AM Sam Overdorf wrote: > Control-c does not get me out of the "erl" command line any more. > Why not? > > I was able to reproduce the same behaviour in my windows machine and found a bug in the new poll implementation that effects windows that makes it not react to break (ctrl-c or ctrl-break). I'll put in a fix to be released in the next maintenance release. Thanks for reporting this issue. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From codewiget95@REDACTED Fri Jul 13 23:00:38 2018 From: codewiget95@REDACTED (Code Wiget) Date: Fri, 13 Jul 2018 17:00:38 -0400 Subject: [erlang-questions] Issues with ets:match_delete In-Reply-To: <1531496657.13439.8.camel@erlang.org> References: <1531481076.13439.0.camel@ericsson.com> <5ed95165-ee29-4295-9137-117f01e5cf95@Spark> <1531496657.13439.8.camel@erlang.org> Message-ID: <93ea3c52-d96a-4db9-bbc2-b8999033e3c2@Spark> Yes.. that was it, thank you! On Jul 13, 2018, 11:44 AM -0400, Sverker Eriksson , wrote: > The table is 'protected', meaning only the owner?<0.1064.0> can write to it. > > /Sverker > > > On fre, 2018-07-13 at 11:05 -0400, Code Wiget wrote: > > Here is a full run of it. I am working on the open source project cqerl: > > > > (NODE)19> [Test] = ets:match_object(cqerl_clusters, {'_', '_', {Node, '$1'}}). > > [{cluster_table,'$primary_cluster', > > ? ? ? ? ? ? ? ? {{{192,168,1,104},9042}, > > ? ? ? ? ? ? ? ? ?[{cassandra_nodes,[{<<"192.168.1.107">>,9042}, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {<<"192.168.1.104">>,9042}]}, > > ? ? ? ? ? ? ? ? ? {keyspace,devices}, > > ? ? ? ? ? ? ? ? ? {included_applications,[]}, > > ? ? ? ? ? ? ? ? ? {reconnect_interval,12}]}}] > > (NODE)20> ets:delete_object(cqerl_clusters, Test). > > ** exception error: bad argument > > ? ? ?in function ?ets:delete_object/2 > > ? ? ? ? called as ets:delete_object(cqerl_clusters, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {cluster_table,'$primary_cluster', > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{{{192,168,1,104},9042}, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{cassandra_nodes,[{<<"192.168.1.107">>,9042}, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{<<"192.168.1.104">>,9042}]}, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{keyspace,devices}, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{included_applications,[]}, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?{reconnect_interval,12}]}}) > > (NODE)21> ets:delete_object(cqerl_clusters, [Test]). > > ** exception error: bad argument > > ? ? ?in function ?ets:delete_object/2 > > ? ? ? ? called as ets:delete_object(cqerl_clusters, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{cluster_table,'$primary_cluster', > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {{{192,168,1,104},9042}, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?[{cassandra_nodes,[{<<"192.168.1.107">>,9042}, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {<<"192.168.1.104">>,9042}]}, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {keyspace,devices}, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {included_applications,[]}, > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? {reconnect_interval,12}]}}]) > > > > Cant figure why the match is working but not the delete.. > > > > On Jul 13, 2018, 11:01 AM -0400, Code Wiget , wrote: > > > Here, it seems alive > > > > > > (NODE13> ets:info(table_name). > > > [{read_concurrency,true}, > > > ?{write_concurrency,false}, > > > ?{compressed,false}, > > > ?{memory,422}, > > > ?{owner,<0.1064.0>}, > > > ?{heir,none}, > > > ?{name,cqerl_clusters}, > > > ?{size,2}, > > > ?{node,?NODE'}, > > > ?{named_table,true}, > > > ?{type,bag}, > > > ?{keypos,2}, > > > ?{protection,protected}] > > > > > > > > > On Jul 13, 2018, 7:24 AM -0400, Sverker Eriksson , wrote: > > > > Your ets:match_delete looks fine. > > > > Are you sure the table is still alive? Try ets:info(table_name). > > > > > > > > When you get an exception in the Erlang shell, the shell process will terminate and be restarted > > > > losing all process specific resources such as ets tables. > > > > > > > > > > > > /Sverker, Erlang/OTP > > > > > > > > > > > > On tor, 2018-07-12 at 16:35 -0400, Code Wiget wrote: > > > > > Hey everyone, > > > > > > > > > > Lets say you have an ets table with entries as shown below: > > > > > > > > > > {table_name, key, {A, [B]}. > > > > > > > > > > I am trying to delete all table entries matching A. I can create a match like so: > > > > > > > > > > ets:match(table_name, {'_', '_', {Node, '$1'}}) > > > > > > > > > > and it returns the values for B. But when I run match_delete or select_delete, I get a badarg error?: > > > > > > > > > > > ets:match_delete(table_name, {'_', '_', {Node, '$1'}}). > > > > > > ** exception error: bad argument > > > > > > ? ? ?in function ?ets:select_delete/2 > > > > > > ? ? ? ? called as ets:select_delete(table_name, > > > > > > ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? [{{'_','_',{{{192,168,1,104},9042},'$1'}},[],[true]}]) > > > > > > ? ? ?in call from ets:match_delete/2 (ets.erl, line 726) > > > > > > (NODE)16> ets:select_delete(table_name, {'_', '_', {Node, '$1'}}). > > > > > > ** exception error: bad argument > > > > > > ? ? ?in function ?ets:select_delete/2 > > > > > > ? ? ? ? called as ets:select_delete(table_name,{'_','_',{{{192,168,1,104},9042},'$1'}}) > > > > > > > > > > So I tried to match and object and delete it... > > > > > > > > > > > (NODE)17> ets:match_object(table_name, {'_', '_', {Node, '$1'}}). > > > > > > [{table_name,'$primary_cluster', > > > > > > ? ? ? ? ? ? ? ? Info?] > > > > > > > > > > > > > > > > > > (NODE)25> ets:delete_object(table_name, Info). > > > > > > ** exception error: bad argument > > > > > > ? ? ?in function ?ets:delete_object/2 > > > > > > ? ? ? ? called as ets:delete_object(table_name, ?. ) > > > > > > > > > > > I would like to avoid re-creating the table structure, as it is not from a project that I created and would take some time to fix all the code. How do I delete something from this table? > > > > > > > > > > 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 > > _______________________________________________ > > 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 mikpelinux@REDACTED Sat Jul 14 10:54:49 2018 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Sat, 14 Jul 2018 10:54:49 +0200 Subject: [erlang-questions] Filtering hierarchical data structure In-Reply-To: References: Message-ID: On Fri, Jul 13, 2018 at 3:25 PM, Stanislav Ledenev wrote: > Hello, > > I am new to Erlang and functional programming (1-1.5 months) and have task: > > 1. Suppose we have hierarchical tree-like data structure: > L = [ > {section, "id1", [ > {section, "id1.1", [ > {policy, "p1", "v1"}, > {policy, "p2", "v2"} > ]}, > {section, "id1.2", [ > ]} > ]}, > {section, "id2", [ > {policy, "p3", "v3"} > ] }, > {section, "id3", [ > ] } > ] > > 2. List of some "section"'s with children elements any of which could be > another "section" with children or "policy" with name and value. > > 3. Also we have another list which contains identifiers of policies: > F = ["p1", "p3"]. > 4. Now I need to write a function which takes lists L, F and returns list L2 > such as L2 contains only those "section"'s which has "policies" wich Id > equals to those in F. Empty sections must be removed. > > For lists L and F result should be: > L2 = [ > {section, "id1", [ > {section, "id1.1", [ > {policy, "p1", "v1"}, > ]}, > ]}, > {section, "id2", [ > {policy, "p3", "v3"} > ] }, > ] > > 5. I have solution (please see below) but it seems to me not as good as > it can be and even little weird. I am sure that it could be improved > and done in proper way. > If anyone could give me any glimpse or advice I would appreciate. > > Source: > --------------------------------------------------------------------------- > main() -> > L = [ > {section, "id1", [ > {section, "id1.1", [ > {policy, "p1", "v1"}, > {policy, "p2", "v2"} > ]}, > {section, "id1.2", [ > ]} > ]}, > {section, "id2", [ > {policy, "p3", "v3"} > ] }, > {section, "id3", [ > ] } > ], > %filter(L, ["p1", "p3"]). > filter(L, ["p3"]). > > filter([H | T], Search) -> > lists:flatten([filter(H, Search, []) | filter(T, Search, [])]). > > filter({section, I, C}, Search, _Acc) -> > NewC = filter(C, Search, []), > case NewC of > [] -> []; > _ -> {section, I, NewC} > end; > > filter([{section, I, C} | T], Search, Acc) -> > NewC = filter(C, Search, []), > case NewC of > [] -> filter(T, Search, Acc); > _ -> filter(T, Search, [{section, I, NewC} | Acc]) > end; > > filter([{policy, I, V} | T], Search, Acc) -> > case lists:member(I, Search) of > true -> filter(T, Search, [{policy, I, V} | Acc]); > false -> filter(T, Search, Acc) > end; > filter([], _S, Acc) -> Acc. Just some high-level comments. - Your data is clearly layered (there are items which can be policies or sections, and sections in turn contain lists of items), but your filtering code conflates these and in turn gets confused as to what it's processing, hence the large number of cases in filter/3. Also, your code would crash if the top-level lists starts with a policy, but accepts it elsewhere, which smells like a bug. - You roll your own logic for reassembling the filtered-out fragments, which gets unnecessarily fiddly, and in this case I think wrong (you reorder items). - Using lists:filtermap/2 would greatly simplify your code. From s.ledenev@REDACTED Sat Jul 14 14:41:34 2018 From: s.ledenev@REDACTED (Stanislav Ledenev) Date: Sat, 14 Jul 2018 15:41:34 +0300 Subject: [erlang-questions] Filtering hierarchical data structure In-Reply-To: References: Message-ID: Mikael, thank you very much for a hint! After some reasoning I came up to this solution: filter(List, Search) -> ??? F = fun F({policy, I, _}) -> lists:member(I, Search); ??????????? F({section, SI, C}) -> ??????????????? R = lists:filtermap(F, C), ??????????????? case R of ??????????????????? [] -> false; ??????????????????? _ -> {true, {section, SI, R}} ??????????????? end; ??????????? F({section, _, []}) -> false ??????? end, ??? lists:filtermap(F, List). It doesn't seem that it could be improved more. On 14.07.2018 11:54, Mikael Pettersson wrote: > On Fri, Jul 13, 2018 at 3:25 PM, Stanislav Ledenev wrote: >> Hello, >> >> I am new to Erlang and functional programming (1-1.5 months) and have task: >> >> 1. Suppose we have hierarchical tree-like data structure: >> L = [ >> {section, "id1", [ >> {section, "id1.1", [ >> {policy, "p1", "v1"}, >> {policy, "p2", "v2"} >> ]}, >> {section, "id1.2", [ >> ]} >> ]}, >> {section, "id2", [ >> {policy, "p3", "v3"} >> ] }, >> {section, "id3", [ >> ] } >> ] >> >> 2. List of some "section"'s with children elements any of which could be >> another "section" with children or "policy" with name and value. >> >> 3. Also we have another list which contains identifiers of policies: >> F = ["p1", "p3"]. >> 4. Now I need to write a function which takes lists L, F and returns list L2 >> such as L2 contains only those "section"'s which has "policies" wich Id >> equals to those in F. Empty sections must be removed. >> >> For lists L and F result should be: >> L2 = [ >> {section, "id1", [ >> {section, "id1.1", [ >> {policy, "p1", "v1"}, >> ]}, >> ]}, >> {section, "id2", [ >> {policy, "p3", "v3"} >> ] }, >> ] >> >> 5. I have solution (please see below) but it seems to me not as good as >> it can be and even little weird. I am sure that it could be improved >> and done in proper way. >> If anyone could give me any glimpse or advice I would appreciate. >> >> Source: >> --------------------------------------------------------------------------- >> main() -> >> L = [ >> {section, "id1", [ >> {section, "id1.1", [ >> {policy, "p1", "v1"}, >> {policy, "p2", "v2"} >> ]}, >> {section, "id1.2", [ >> ]} >> ]}, >> {section, "id2", [ >> {policy, "p3", "v3"} >> ] }, >> {section, "id3", [ >> ] } >> ], >> %filter(L, ["p1", "p3"]). >> filter(L, ["p3"]). >> >> filter([H | T], Search) -> >> lists:flatten([filter(H, Search, []) | filter(T, Search, [])]). >> >> filter({section, I, C}, Search, _Acc) -> >> NewC = filter(C, Search, []), >> case NewC of >> [] -> []; >> _ -> {section, I, NewC} >> end; >> >> filter([{section, I, C} | T], Search, Acc) -> >> NewC = filter(C, Search, []), >> case NewC of >> [] -> filter(T, Search, Acc); >> _ -> filter(T, Search, [{section, I, NewC} | Acc]) >> end; >> >> filter([{policy, I, V} | T], Search, Acc) -> >> case lists:member(I, Search) of >> true -> filter(T, Search, [{policy, I, V} | Acc]); >> false -> filter(T, Search, Acc) >> end; >> filter([], _S, Acc) -> Acc. > Just some high-level comments. > > - Your data is clearly layered (there are items which can be policies > or sections, and sections in turn contain lists of items), but your > filtering code conflates these and in turn gets confused as to what > it's processing, hence the large number of cases in filter/3. Also, > your code would crash if the top-level lists starts with a policy, but > accepts it elsewhere, which smells like a bug. > - You roll your own logic for reassembling the filtered-out fragments, > which gets unnecessarily fiddly, and in this case I think wrong (you > reorder items). > - Using lists:filtermap/2 would greatly simplify your code. From be.dmitry@REDACTED Sat Jul 14 15:35:37 2018 From: be.dmitry@REDACTED (Dmitry Belyaev) Date: Sat, 14 Jul 2018 23:35:37 +1000 Subject: [erlang-questions] Filtering hierarchical data structure In-Reply-To: References: Message-ID: <1414AC57-C3F5-425D-BD09-1F06FCEDB976@gmail.com> You can improve it by removing the last clause F({section, _, []}) -> false On 14 July 2018 22:41:34 GMT+10:00, Stanislav Ledenev wrote: >Mikael, thank you very much for a hint! > >After some reasoning I came up to this solution: > >filter(List, Search) -> > ??? F = fun F({policy, I, _}) -> lists:member(I, Search); > ??????????? F({section, SI, C}) -> > ??????????????? R = lists:filtermap(F, C), > ??????????????? case R of > ??????????????????? [] -> false; > ??????????????????? _ -> {true, {section, SI, R}} > ??????????????? end; > ??????????? F({section, _, []}) -> false > ??????? end, > ??? lists:filtermap(F, List). > >It doesn't seem that it could be improved more. > >On 14.07.2018 11:54, Mikael Pettersson wrote: >> On Fri, Jul 13, 2018 at 3:25 PM, Stanislav Ledenev > wrote: >>> Hello, >>> >>> I am new to Erlang and functional programming (1-1.5 months) and >have task: >>> >>> 1. Suppose we have hierarchical tree-like data structure: >>> L = [ >>> {section, "id1", [ >>> {section, "id1.1", [ >>> {policy, "p1", "v1"}, >>> {policy, "p2", "v2"} >>> ]}, >>> {section, "id1.2", [ >>> ]} >>> ]}, >>> {section, "id2", [ >>> {policy, "p3", "v3"} >>> ] }, >>> {section, "id3", [ >>> ] } >>> ] >>> >>> 2. List of some "section"'s with children elements any of which >could be >>> another "section" with children or "policy" with name and value. >>> >>> 3. Also we have another list which contains identifiers of policies: >>> F = ["p1", "p3"]. >>> 4. Now I need to write a function which takes lists L, F and returns >list L2 >>> such as L2 contains only those "section"'s which has "policies" wich >Id >>> equals to those in F. Empty sections must be removed. >>> >>> For lists L and F result should be: >>> L2 = [ >>> {section, "id1", [ >>> {section, "id1.1", [ >>> {policy, "p1", "v1"}, >>> ]}, >>> ]}, >>> {section, "id2", [ >>> {policy, "p3", "v3"} >>> ] }, >>> ] >>> >>> 5. I have solution (please see below) but it seems to me not as good >as >>> it can be and even little weird. I am sure that it could be improved >>> and done in proper way. >>> If anyone could give me any glimpse or advice I would appreciate. >>> >>> Source: >>> >--------------------------------------------------------------------------- >>> main() -> >>> L = [ >>> {section, "id1", [ >>> {section, "id1.1", [ >>> {policy, "p1", "v1"}, >>> {policy, "p2", "v2"} >>> ]}, >>> {section, "id1.2", [ >>> ]} >>> ]}, >>> {section, "id2", [ >>> {policy, "p3", "v3"} >>> ] }, >>> {section, "id3", [ >>> ] } >>> ], >>> %filter(L, ["p1", "p3"]). >>> filter(L, ["p3"]). >>> >>> filter([H | T], Search) -> >>> lists:flatten([filter(H, Search, []) | filter(T, Search, [])]). >>> >>> filter({section, I, C}, Search, _Acc) -> >>> NewC = filter(C, Search, []), >>> case NewC of >>> [] -> []; >>> _ -> {section, I, NewC} >>> end; >>> >>> filter([{section, I, C} | T], Search, Acc) -> >>> NewC = filter(C, Search, []), >>> case NewC of >>> [] -> filter(T, Search, Acc); >>> _ -> filter(T, Search, [{section, I, NewC} | Acc]) >>> end; >>> >>> filter([{policy, I, V} | T], Search, Acc) -> >>> case lists:member(I, Search) of >>> true -> filter(T, Search, [{policy, I, V} | Acc]); >>> false -> filter(T, Search, Acc) >>> end; >>> filter([], _S, Acc) -> Acc. >> Just some high-level comments. >> >> - Your data is clearly layered (there are items which can be policies >> or sections, and sections in turn contain lists of items), but your >> filtering code conflates these and in turn gets confused as to what >> it's processing, hence the large number of cases in filter/3. Also, >> your code would crash if the top-level lists starts with a policy, >but >> accepts it elsewhere, which smells like a bug. >> - You roll your own logic for reassembling the filtered-out >fragments, >> which gets unnecessarily fiddly, and in this case I think wrong (you >> reorder items). >> - Using lists:filtermap/2 would greatly simplify your code. > >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -- Kind regards, Dmitry Belyaev -------------- next part -------------- An HTML attachment was scrubbed... URL: From s.ledenev@REDACTED Sat Jul 14 15:39:34 2018 From: s.ledenev@REDACTED (Stanislav Ledenev) Date: Sat, 14 Jul 2018 16:39:34 +0300 Subject: [erlang-questions] Filtering hierarchical data structure In-Reply-To: <1414AC57-C3F5-425D-BD09-1F06FCEDB976@gmail.com> References: <1414AC57-C3F5-425D-BD09-1F06FCEDB976@gmail.com> Message-ID: <645e308c-98e7-f4b6-14ea-a5330e2b4f4c@gmail.com> Yes, I've skipped this one. Thank you! On 14.07.2018 16:35, Dmitry Belyaev wrote: > You can improve it by removing the last clause > F({section, _, []}) -> false > > > On 14 July 2018 22:41:34 GMT+10:00, Stanislav Ledenev > wrote: > > Mikael, thank you very much for a hint! > > After some reasoning I came up to this solution: > > filter(List, Search) -> > ??? F = fun F({policy, I, _}) -> lists:member(I, Search); > ??????????? F({section, SI, C}) -> > ??????????????? R = lists:filtermap(F, C), > ??????????????? case R of > ??????????????????? [] -> false; > ??????????????????? _ -> {true, {section, SI, R}} > ??????????????? end; > ??????????? F({section, _, []}) -> false > ??????? end, > ??? lists:filtermap(F, List). > > It doesn't seem that it could be improved more. > > On 14.07.2018 11:54, Mikael Pettersson wrote: > > On Fri, Jul 13, 2018 at 3:25 PM, Stanislav Ledenev > wrote: > > Hello, I am new to Erlang and functional programming > (1-1.5 months) and have task: 1. Suppose we have > hierarchical tree-like data structure: L = [ {section, > "id1", [ {section, "id1.1", [ {policy, "p1", "v1"}, > {policy, "p2", "v2"} ]}, {section, "id1.2", [ ]} ]}, > {section, "id2", [ {policy, "p3", "v3"} ] }, {section, > "id3", [ ] } ] 2. List of some "section"'s with children > elements any of which could be another "section" with > children or "policy" with name and value. 3. Also we have > another list which contains identifiers of policies: F = > ["p1", "p3"]. 4. Now I need to write a function which > takes lists L, F and returns list L2 such as L2 contains > only those "section"'s which has "policies" wich Id equals > to those in F. Empty sections must be removed. For lists L > and F result should be: L2 = [ {section, "id1", [ > {section, "id1.1", [ {policy, "p1", "v1"}, ]}, ]}, > {section, "id2", [ {policy, "p3", "v3"} ] }, ] 5. I have > solution (please see below) but it seems to me not as good > as it can be and even little weird. I am sure that it > could be improved and done in proper way. If anyone could > give me any glimpse or advice I would appreciate. Source: > ------------------------------------------------------------------------ > main() -> L = [ {section, "id1", [ {section, "id1.1", [ > {policy, "p1", "v1"}, {policy, "p2", "v2"} ]}, {section, > "id1.2", [ ]} ]}, {section, "id2", [ {policy, "p3", "v3"} > ] }, {section, "id3", [ ] } ], %filter(L, ["p1", "p3"]). > filter(L, ["p3"]). filter([H | T], Search) -> > lists:flatten([filter(H, Search, []) | filter(T, Search, > [])]). filter({section, I, C}, Search, _Acc) -> NewC = > filter(C, Search, []), case NewC of [] -> []; _ -> > {section, I, NewC} end; filter([{section, I, C} | T], > Search, Acc) -> NewC = filter(C, Search, []), case NewC of > [] -> filter(T, Search, Acc); _ -> filter(T, Search, > [{section, I, NewC} | Acc]) end; filter([{policy, I, V} | > T], Search, Acc) -> case lists:member(I, Search) of true > -> filter(T, Search, [{policy, I, V} | Acc]); false -> > filter(T, Search, Acc) end; filter([], _S, Acc) -> Acc. > > Just some high-level comments. - Your data is clearly layered > (there are items which can be policies or sections, and > sections in turn contain lists of items), but your filtering > code conflates these and in turn gets confused as to what it's > processing, hence the large number of cases in filter/3. Also, > your code would crash if the top-level lists starts with a > policy, but accepts it elsewhere, which smells like a bug. - > You roll your own logic for reassembling the filtered-out > fragments, which gets unnecessarily fiddly, and in this case I > think wrong (you reorder items). - Using lists:filtermap/2 > would greatly simplify your code. > > > ------------------------------------------------------------------------ > > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -- > Kind regards, > Dmitry Belyaev > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- -- Stanislav Ledenev -------------- next part -------------- An HTML attachment was scrubbed... URL: From g9414002.pccu.edu.tw@REDACTED Sun Jul 15 06:17:09 2018 From: g9414002.pccu.edu.tw@REDACTED (=?UTF-8?B?6buD6ICA6LOiIChZYXUtSHNpZW4gSHVhbmcp?=) Date: Sun, 15 Jul 2018 12:17:09 +0800 Subject: [erlang-questions] Filtering hierarchical data structure In-Reply-To: References: Message-ID: filter([H | T], Search) -> lists:flatten([filter(H, Search, []) | filter(T, Search, [])]). and filter([], _S, Acc) -> Acc. may be rewrote to + filter(List, Search) -> filter(List, Search, []). + filter([], _, Acc) -> lists:reverse(Acc). On Fri, Jul 13, 2018 at 9:25 PM, Stanislav Ledenev wrote: > Hello, > > I am new to Erlang and functional programming (1-1.5 months) and have task: > > 1. Suppose we have hierarchical tree-like data structure: > L = [ > {section, "id1", [ > {section, "id1.1", [ > {policy, "p1", "v1"}, > {policy, "p2", "v2"} > ]}, > {section, "id1.2", [ > ]} > ]}, > {section, "id2", [ > {policy, "p3", "v3"} > ] }, > {section, "id3", [ > ] } > ] > > 2. List of some "section"'s with children elements any of which could be > another "section" with children or "policy" with name and value. > > 3. Also we have another list which contains identifiers of policies: > F = ["p1", "p3"]. > 4. Now I need to write a function which takes lists L, F and returns list > L2 > such as L2 contains only those "section"'s which has "policies" wich Id > equals to those in F. Empty sections must be removed. > > For lists L and F result should be: > L2 = [ > {section, "id1", [ > {section, "id1.1", [ > {policy, "p1", "v1"}, > ]}, > ]}, > {section, "id2", [ > {policy, "p3", "v3"} > ] }, > ] > > 5. I have solution (please see below) but it seems to me not as good as > it can be and even little weird. I am sure that it could be improved > and done in proper way. > If anyone could give me any glimpse or advice I would appreciate. > > Source: > ------------------------------------------------------------ > --------------- > main() -> > L = [ > {section, "id1", [ > {section, "id1.1", [ > {policy, "p1", "v1"}, > {policy, "p2", "v2"} > ]}, > {section, "id1.2", [ > ]} > ]}, > {section, "id2", [ > {policy, "p3", "v3"} > ] }, > {section, "id3", [ > ] } > ], > %filter(L, ["p1", "p3"]). > filter(L, ["p3"]). > > filter([H | T], Search) -> > lists:flatten([filter(H, Search, []) | filter(T, Search, [])]). > > filter({section, I, C}, Search, _Acc) -> > NewC = filter(C, Search, []), > case NewC of > [] -> []; > _ -> {section, I, NewC} > end; > > filter([{section, I, C} | T], Search, Acc) -> > NewC = filter(C, Search, []), > case NewC of > [] -> filter(T, Search, Acc); > _ -> filter(T, Search, [{section, I, NewC} | Acc]) > end; > > filter([{policy, I, V} | T], Search, Acc) -> > case lists:member(I, Search) of > true -> filter(T, Search, [{policy, I, V} | Acc]); > false -> filter(T, Search, Acc) > end; > filter([], _S, Acc) -> Acc. > > -- Stanislav Ledenev > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Best Regards. --- Y-H. H. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kuna.prime@REDACTED Mon Jul 16 02:07:09 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Mon, 16 Jul 2018 02:07:09 +0200 Subject: [erlang-questions] Testing for improper list Message-ID: Hello everyone, Is there any built in method of checking if list is improper? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Mon Jul 16 02:17:21 2018 From: g@REDACTED (Guilherme Andrade) Date: Mon, 16 Jul 2018 01:17:21 +0100 Subject: [erlang-questions] Testing for improper list In-Reply-To: References: Message-ID: Hello Karlo, On 16 July 2018 at 01:07, Karlo Kuna wrote: > Is there any built in method of checking if list is improper? > Something like this should do: > is_improper_list(Value) when length(Value) >= 0 -> > false; > is_improper_list(Value) -> > is_list(Value). `length/1' will fail upon Value being an improper list. -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From g@REDACTED Mon Jul 16 02:19:58 2018 From: g@REDACTED (Guilherme Andrade) Date: Mon, 16 Jul 2018 01:19:58 +0100 Subject: [erlang-questions] Testing for improper list In-Reply-To: References: Message-ID: (I now notice I misread your question; I don't believe there is any built-in function for it, no.) -- Guilherme -------------- next part -------------- An HTML attachment was scrubbed... URL: From g9414002.pccu.edu.tw@REDACTED Mon Jul 16 04:37:35 2018 From: g9414002.pccu.edu.tw@REDACTED (=?UTF-8?B?6buD6ICA6LOiIChZYXUtSHNpZW4gSHVhbmcp?=) Date: Mon, 16 Jul 2018 10:37:35 +0800 Subject: [erlang-questions] Testing for improper list In-Reply-To: References: Message-ID: As off topic, the is_improper_list/1 may be rewritten to ... is_improper_list([_|Value]) -> is_improper_list(Value); On Mon, Jul 16, 2018 at 8:17 AM, Guilherme Andrade wrote: > Hello Karlo, > > On 16 July 2018 at 01:07, Karlo Kuna wrote: > >> Is there any built in method of checking if list is improper? >> > > Something like this should do: > > > is_improper_list(Value) when length(Value) >= 0 > -> > > > > false; > > > > > is_improper_list(Value) -> > > > > > is_list(Value). > > `length/1' will fail upon Value being an improper list. > > -- > Guilherme > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Best Regards. --- Y-H. H. -------------- next part -------------- An HTML attachment was scrubbed... URL: From getonga@REDACTED Mon Jul 16 11:39:23 2018 From: getonga@REDACTED (=?utf-8?B?Z2V0b25nYQ==?=) Date: Mon, 16 Jul 2018 17:39:23 +0800 Subject: [erlang-questions] Does anyone still use poolboy, the poolboy needs to update for otp 21. Message-ID: I made a pr to poolboy, see https://github.com/devinus/poolboy But after 17 days, it does not be merged, and no reaction too. Help is needed. -------------- next part -------------- An HTML attachment was scrubbed... URL: From jordanchaitin@REDACTED Mon Jul 16 13:50:14 2018 From: jordanchaitin@REDACTED (JC) Date: Mon, 16 Jul 2018 17:20:14 +0530 Subject: [erlang-questions] Does anyone still use poolboy, the poolboy needs to update for otp 21. In-Reply-To: References: Message-ID: <733fd171-bba1-6bf0-88dd-a2b4aa7f4be1@gmail.com> I belive pgapp (https://github.com/epgsql/pgapp), a commonly used frontend (the backend being the Erlang Postgresql database client library Epgsql - https://github.com/epgsql/epgsql), uses poolboy. On 7/16/18 15:09, getonga wrote: > I made a pr to?poolboy, see?https://github.com/devinus/poolboy > But after 17 days, it does not be merged, and no reaction too. > Help is needed. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From k.petrauskas@REDACTED Mon Jul 16 13:58:27 2018 From: k.petrauskas@REDACTED (Karolis Petrauskas) Date: Mon, 16 Jul 2018 14:58:27 +0300 Subject: [erlang-questions] Does anyone still use poolboy, the poolboy needs to update for otp 21. In-Reply-To: <733fd171-bba1-6bf0-88dd-a2b4aa7f4be1@gmail.com> References: <733fd171-bba1-6bf0-88dd-a2b4aa7f4be1@gmail.com> Message-ID: I'm using the poolboy library, through I have no write access to the devinus/poolboy repository. Its a vocation time now, maybe you should wait a bit. Karolis On Mon, Jul 16, 2018 at 2:50 PM, JC wrote: > I belive pgapp (https://github.com/epgsql/pgapp), a commonly used frontend > (the backend being the Erlang Postgresql database client library Epgsql - > https://github.com/epgsql/epgsql), uses poolboy. > > > > On 7/16/18 15:09, getonga wrote: > > I made a pr to poolboy, see https://github.com/devinus/poolboy > But after 17 days, it does not be merged, and no reaction too. > Help is needed. > > > _______________________________________________ > 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 michal@REDACTED Mon Jul 16 14:00:28 2018 From: michal@REDACTED (=?utf-8?Q?Micha=C5=82_Muska=C5=82a?=) Date: Mon, 16 Jul 2018 14:00:28 +0200 Subject: [erlang-questions] Does anyone still use poolboy, the poolboy needs to update for otp 21. In-Reply-To: References: Message-ID: <31de87f6-51cf-4ee5-8f33-e0d06288c182@Spark> FWIW it averages about 9k downloads a day on Hex, so it's definitely used?https://hex.pm/packages/poolboy Last release (at least on hex) was over 3 years ago, though. Micha?. On 16 Jul 2018, 11:39 +0200, getonga , wrote: > I made a pr to?poolboy, see?https://github.com/devinus/poolboy > But after 17 days, it does not be merged, and no reaction too. > Help is needed. > _______________________________________________ > 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 Mon Jul 16 14:29:08 2018 From: roger@REDACTED (Roger Lipscombe) Date: Mon, 16 Jul 2018 13:29:08 +0100 Subject: [erlang-questions] Does anyone still use poolboy, the poolboy needs to update for otp 21. In-Reply-To: References: Message-ID: We use it, and it's working fine on OTP-21.0. On 16 July 2018 at 10:39, getonga wrote: > I made a pr to poolboy, see https://github.com/devinus/poolboy > But after 17 days, it does not be merged, and no reaction too. > Help is needed. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From getonga@REDACTED Mon Jul 16 15:08:02 2018 From: getonga@REDACTED (=?utf-8?B?Z2V0b25nYQ==?=) Date: Mon, 16 Jul 2018 21:08:02 +0800 Subject: [erlang-questions] Does anyone still use poolboy, the poolboy needs to update for otp 21. Message-ID: The pr address is https://github.com/devinus/poolboy/pull/104You can take a look at it. -------------- next part -------------- An HTML attachment was scrubbed... URL: From getonga@REDACTED Mon Jul 16 15:09:03 2018 From: getonga@REDACTED (=?utf-8?B?Z2V0b25nYQ==?=) Date: Mon, 16 Jul 2018 21:09:03 +0800 Subject: [erlang-questions] Does anyone still use poolboy, the poolboy needs to update for otp 21. Message-ID: The pr address is https://github.com/devinus/poolboy/pull/104 -------------- next part -------------- An HTML attachment was scrubbed... URL: From g9414002.pccu.edu.tw@REDACTED Mon Jul 16 16:17:14 2018 From: g9414002.pccu.edu.tw@REDACTED (=?UTF-8?B?6buD6ICA6LOiIChZYXUtSHNpZW4gSHVhbmcp?=) Date: Mon, 16 Jul 2018 22:17:14 +0800 Subject: [erlang-questions] Testing for improper list In-Reply-To: References: Message-ID: Yes, Richard, I gave the name because of language issue that I made the is_improper_list/1 working but not be aware of its literal meaning, when I reconsidered Guilherme's code. The reason to consider a built-in may be that it won't work when applying length/1 to a value [a|b], getting a bad_arg error. And is_list/1 does not determine whether a value is an improper list. Then there shell be an augmented version of is_list/1, that ... is_improper_list([]) -> false; is_improper_list([_|Value]) -> is_improper_list(Value); is_improper_list(_) -> true. Though the good use is to avoid writing some code to put any improper list to your system. On Mon, Jul 16, 2018 at 8:51 PM, Richard O'Keefe wrote: > It is not entirely clear what you mean by > an improper list. Presumably [a|b] is an > improper list, but is b all by itself an > improper list, or what? > > I'd be tempted to go with > is_not_a_proper_list(X) when length(X) >= 0 -> false; > is_not_a_proper_list(_) -> true. > but more importantly, > > - why do you want a built-in (as opposed to a library > function)? > - why do you want this at all? > > > > On 16 July 2018 at 14:37, ??? (Yau-Hsien Huang) < > g9414002.pccu.edu.tw@REDACTED> wrote: > >> As off topic, the is_improper_list/1 may be rewritten to ... >> >> is_improper_list([_|Value]) -> is_improper_list(Value); >> >> On Mon, Jul 16, 2018 at 8:17 AM, Guilherme Andrade >> wrote: >> >>> Hello Karlo, >>> >>> On 16 July 2018 at 01:07, Karlo Kuna wrote: >>> >>>> Is there any built in method of checking if list is improper? >>>> >>> >>> Something like this should do: >>> >>> > is_improper_list(Value) when length(Value) >= 0 >>> -> >>> >>> >>> > false; >>> >>> >>> >>> > is_improper_list(Value) -> >>> >>> >>> >>> > is_list(Value). >>> >>> `length/1' will fail upon Value being an improper list. >>> >>> -- >>> Guilherme >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> >> >> -- >> >> Best Regards. >> >> --- Y-H. H. >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- Best Regards. --- Y-H. H. -------------- next part -------------- An HTML attachment was scrubbed... URL: From tty.erlang@REDACTED Mon Jul 16 16:38:57 2018 From: tty.erlang@REDACTED (T Ty) Date: Mon, 16 Jul 2018 15:38:57 +0100 Subject: [erlang-questions] gen_server:cast/call and {via, Module, ViaName} Message-ID: Hello, Looking a the code I notice that a gen_server:cast({via, M, N}, Msg) would use M:send/2 but there does not seem to be a similar functionality for gen_server:call/2. Was this intentional ? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Mon Jul 16 16:43:25 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Mon, 16 Jul 2018 16:43:25 +0200 Subject: [erlang-questions] gen_server:cast/call and {via, Module, ViaName} In-Reply-To: References: Message-ID: gen_server:call/2 calls gen:call which handles the via tuple. On 07/16/2018 04:38 PM, T Ty wrote: > Hello, > > Looking a the code I notice that a gen_server:cast({via, M, N}, Msg) > would use M:send/2 but there does not seem to be a similar functionality > for gen_server:call/2. > > Was this intentional ? > > Thanks > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From tty.erlang@REDACTED Mon Jul 16 17:18:13 2018 From: tty.erlang@REDACTED (T Ty) Date: Mon, 16 Jul 2018 16:18:13 +0100 Subject: [erlang-questions] gen_server:cast/call and {via, Module, ViaName} In-Reply-To: References: Message-ID: gen:call uses erlang:send/2 after finding the pid() using the via tuple. Where else for gen_server:cast (line 224) it uses the ViaModule:send/2 function instead of erlang:send/2 On Mon, Jul 16, 2018 at 3:43 PM, Lo?c Hoguin wrote: > gen_server:call/2 calls gen:call which handles the via tuple. > > > On 07/16/2018 04:38 PM, T Ty wrote: > >> Hello, >> >> Looking a the code I notice that a gen_server:cast({via, M, N}, Msg) >> would use M:send/2 but there does not seem to be a similar functionality >> for gen_server:call/2. >> >> Was this intentional ? >> >> Thanks >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- > Lo?c Hoguin > https://ninenines.eu > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g9414002.pccu.edu.tw@REDACTED Mon Jul 16 17:38:30 2018 From: g9414002.pccu.edu.tw@REDACTED (=?UTF-8?B?6buD6ICA6LOiIChZYXUtSHNpZW4gSHVhbmcp?=) Date: Mon, 16 Jul 2018 23:38:30 +0800 Subject: [erlang-questions] gen_server:cast/call and {via, Module, ViaName} In-Reply-To: References: Message-ID: gen_server:call/2 performs synchronous approach, while gen_server:cast/2, asynchronous approach. On Mon, Jul 16, 2018 at 11:18 PM, T Ty wrote: > gen:call uses erlang:send/2 after finding the pid() using the via tuple. > > Where else for gen_server:cast (line 224) it uses the ViaModule:send/2 > function instead of erlang:send/2 > > > On Mon, Jul 16, 2018 at 3:43 PM, Lo?c Hoguin wrote: > >> gen_server:call/2 calls gen:call which handles the via tuple. >> >> >> On 07/16/2018 04:38 PM, T Ty wrote: >> >>> Hello, >>> >>> Looking a the code I notice that a gen_server:cast({via, M, N}, Msg) >>> would use M:send/2 but there does not seem to be a similar functionality >>> for gen_server:call/2. >>> >>> Was this intentional ? >>> >>> Thanks >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> -- >> Lo?c Hoguin >> https://ninenines.eu >> > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Best Regards. --- Y-H. H. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Mon Jul 16 17:55:58 2018 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 16 Jul 2018 17:55:58 +0200 Subject: [erlang-questions] UDP receive performance In-Reply-To: References: <20180524072357.GA97377@erix.ericsson.se> <355E67A6-9883-451D-A31D-8CC710244719@gmail.com> <19DDAEE8-037B-4793-9C83-7D8D5C73C234@mobilearts.com> <0AE32206-3A53-404A-A97E-426E0E974FA1@mobilearts.com> Message-ID: On Fri, Jun 22, 2018 at 10:14 AM Lukas Larsson wrote: > > On Fri, 22 Jun 2018, 03:08 Michael Stellar, wrote: > >> Looks good, does these patch already being committed upstream? >> > > No, and it will be a couple of weeks until it is. I'll post here when it > is merged. > fyi: I just opened a PR with the fixes if you want to track this issue https://github.com/erlang/otp/pull/1876 -------------- next part -------------- An HTML attachment was scrubbed... URL: From kuna.prime@REDACTED Mon Jul 16 18:51:22 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Mon, 16 Jul 2018 18:51:22 +0200 Subject: [erlang-questions] Testing for improper list In-Reply-To: References: Message-ID: i have solution just as Yau-Hsien suggested but i was wandering is there highly optimized version (bif of nif) of this. sure one can easily do NIF but i think is_improper_list/1 or is_proper_list/1 should be in standard library. improper list is pretty clear term in erlang documentation. also why i want this: suppose i want type ob object to be list but i also want some sort of additional information for it, then syntax [...|some_type_or_property] seems elegant. Alternatives are - {some_type_or_property, List} - parse transformations - record or map however as i need/want this as input to file:consult parse transformations are difficult here and object wrappers as tuple, map or record are to verbose and noisy On Mon, Jul 16, 2018 at 4:17 PM ??? (Yau-Hsien Huang) < g9414002.pccu.edu.tw@REDACTED> wrote: > Yes, Richard, I gave the name because of language issue that I made the > is_improper_list/1 working but not be aware of its literal meaning, when I > reconsidered Guilherme's code. > > The reason to consider a built-in may be that it won't work when applying > length/1 to a value [a|b], getting a bad_arg error. And is_list/1 does not > determine whether a value is an improper list. > > Then there shell be an augmented version of is_list/1, that ... > > is_improper_list([]) -> false; > is_improper_list([_|Value]) -> is_improper_list(Value); > is_improper_list(_) -> true. > > Though the good use is to avoid writing some code to put any improper list > to your system. > > > On Mon, Jul 16, 2018 at 8:51 PM, Richard O'Keefe wrote: > >> It is not entirely clear what you mean by >> an improper list. Presumably [a|b] is an >> improper list, but is b all by itself an >> improper list, or what? >> >> I'd be tempted to go with >> is_not_a_proper_list(X) when length(X) >= 0 -> false; >> is_not_a_proper_list(_) -> true. >> but more importantly, >> >> - why do you want a built-in (as opposed to a library >> function)? >> - why do you want this at all? >> >> >> >> On 16 July 2018 at 14:37, ??? (Yau-Hsien Huang) < >> g9414002.pccu.edu.tw@REDACTED> wrote: >> >>> As off topic, the is_improper_list/1 may be rewritten to ... >>> >>> is_improper_list([_|Value]) -> is_improper_list(Value); >>> >>> On Mon, Jul 16, 2018 at 8:17 AM, Guilherme Andrade >>> wrote: >>> >>>> Hello Karlo, >>>> >>>> On 16 July 2018 at 01:07, Karlo Kuna wrote: >>>> >>>>> Is there any built in method of checking if list is improper? >>>>> >>>> >>>> Something like this should do: >>>> >>>> > is_improper_list(Value) when length(Value) >= 0 >>>> -> >>>> >>>> > >>>> false; >>>> >>>> > is_improper_list(Value) >>>> -> >>>> >>>> > is_list(Value). >>>> >>>> `length/1' will fail upon Value being an improper list. >>>> >>>> -- >>>> Guilherme >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >>> >>> -- >>> >>> Best Regards. >>> >>> --- Y-H. H. >>> >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> > > > -- > > Best Regards. > > --- Y-H. H. > > _______________________________________________ > 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 Mon Jul 16 19:09:42 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 16 Jul 2018 19:09:42 +0200 Subject: [erlang-questions] Does anyone still use poolboy, the poolboy needs to update for otp 21. In-Reply-To: References: Message-ID: I'd guess the same. Mind you, getting rid of warnings are nice, but there is no reason to worry before OTP 22.x is about to go out. In other words, the drums should be banged upon louder and louder from pianissimo to fortissimo as we approach the deadline. We are not late yet. We will be late if we don't act. It is in the middle of vacation time as well. Things are likely to move a bit slower than normal. On Mon, Jul 16, 2018 at 2:29 PM Roger Lipscombe wrote: > We use it, and it's working fine on OTP-21.0. > > On 16 July 2018 at 10:39, getonga wrote: > > I made a pr to poolboy, see https://github.com/devinus/poolboy > > But after 17 days, it does not be merged, and no reaction too. > > Help is needed. > > > > _______________________________________________ > > 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 > -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrew@REDACTED Mon Jul 16 19:18:19 2018 From: andrew@REDACTED (Andrew Thompson) Date: Mon, 16 Jul 2018 13:18:19 -0400 Subject: [erlang-questions] Does anyone still use poolboy, the poolboy needs to update for otp 21. In-Reply-To: References: Message-ID: <20180716171819.GB1764@thecloud.hijacked.us> I do have contributor priviliges to the repository, although I don't have a lot of time for maintenence. Maybe we can find someone interested to help? Andrew From tty.erlang@REDACTED Tue Jul 17 10:53:05 2018 From: tty.erlang@REDACTED (T Ty) Date: Tue, 17 Jul 2018 09:53:05 +0100 Subject: [erlang-questions] gen_server:cast/call and {via, Module, ViaName} In-Reply-To: References: Message-ID: Simply put what I was trying to achieve is the following: By using {via, ViaModule, Name} I was trying to trap the cast/calls to a gen_server and manipulate the outgoing message. If the message is "large" (based on the message tuple structure) I can push the message via a separate TCP socket mimicking a separation between data and command channel to avoid saturating the disterl pipe. In any case I'll look at a different setup. On Mon, Jul 16, 2018 at 4:38 PM, ??? (Yau-Hsien Huang) < g9414002.pccu.edu.tw@REDACTED> wrote: > gen_server:call/2 performs synchronous approach, while gen_server:cast/2, > asynchronous approach. > > On Mon, Jul 16, 2018 at 11:18 PM, T Ty wrote: > >> gen:call uses erlang:send/2 after finding the pid() using the via tuple. >> >> Where else for gen_server:cast (line 224) it uses the ViaModule:send/2 >> function instead of erlang:send/2 >> >> >> On Mon, Jul 16, 2018 at 3:43 PM, Lo?c Hoguin wrote: >> >>> gen_server:call/2 calls gen:call which handles the via tuple. >>> >>> >>> On 07/16/2018 04:38 PM, T Ty wrote: >>> >>>> Hello, >>>> >>>> Looking a the code I notice that a gen_server:cast({via, M, N}, Msg) >>>> would use M:send/2 but there does not seem to be a similar functionality >>>> for gen_server:call/2. >>>> >>>> Was this intentional ? >>>> >>>> Thanks >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> -- >>> Lo?c Hoguin >>> https://ninenines.eu >>> >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > > > -- > > Best Regards. > > --- Y-H. H. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From max.lapshin@REDACTED Tue Jul 17 11:10:30 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Tue, 17 Jul 2018 12:10:30 +0300 Subject: [erlang-questions] UDP receive performance In-Reply-To: References: <20180524072357.GA97377@erix.ericsson.se> <355E67A6-9883-451D-A31D-8CC710244719@gmail.com> <19DDAEE8-037B-4793-9C83-7D8D5C73C234@mobilearts.com> <0AE32206-3A53-404A-A97E-426E0E974FA1@mobilearts.com> Message-ID: Will try to check it, because right now we are running separate thread with libevent for capturing udp =( -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrosales@REDACTED Tue Jul 17 12:50:13 2018 From: mrosales@REDACTED (Marcial Rosales) Date: Tue, 17 Jul 2018 12:50:13 +0200 Subject: [erlang-questions] How to pin-point High CPU utilization in Erlang VM Message-ID: We are experiencing a very high cpu utilization in 3 clustered Erlang VMs running RabbitMQ. We have deployed another cluster in an attempt to reproduce the same behaviour without much success. Our goals are: - Find out where the CPU is being utilized - Choose the right tools to analyze CPU utilization Our observations so far: - The *BAD* cluster observes a pretty excessive CPU utilization, both user and system ones, and also network. - The *BAD* cluster also observes a higher Erlang scheduler utilization, specially on microstate emulator and other. We are yet to understand what other could be. According to Erlang documentation is *unaccounted things*. - The *BAD* cluster observes a considerably higher number of system calls which we are yet to identify (dunno how) why is that. - The *BAD* cluster does not necessarily run higher number of reductions. In fact, the *GOOD* cluster runs more reductions and yet has a lower scheduler utilization. METRICBADGOOD user cpu 46% - 57% 19% - 40% system cpu 20% - 37% 1% - 10% network traffic 6M - 19M up to 8M system interrupts 120k - 196k 10k - 20k syscalls 1.6M - 2.1M 49k - 110k task-clock 10sec 68255 12324 cpu profiling info We have gathered lots of metrics in attempt to identify why the BAD cluster uses so much CPU. All the information can be found here https://gist.github.com/MarcialRosales/226716f0cb9e27cd9ab02eac04702841 along with the environment information. We appreciate a lot any insights as to what could be causing the issue and/or in relation to additional tools we could use. Many thanks -- Marcial Rosales Pivotal, Inc. EMEA -------------- next part -------------- An HTML attachment was scrubbed... URL: From by@REDACTED Wed Jul 18 05:21:28 2018 From: by@REDACTED (by) Date: Wed, 18 Jul 2018 11:21:28 +0800 Subject: [erlang-questions] Cowboy serve static files [video file] can not fast forward Message-ID: Hi, I am trying to serve a static website via Cowboy, and I followed the guide, it seems works fine. The problem is that the static website has a mp4 file, and I play the video on web page. It can play, but when I try to click the progress bar to do fast forward, it keeps play on the normal way(not work). Do I need add some other configurations for this? Same static files works fine with nginx. Thanks, Yao Bao From dimmoborgir@REDACTED Wed Jul 18 06:56:30 2018 From: dimmoborgir@REDACTED (Dmitry Simonov) Date: Wed, 18 Jul 2018 09:56:30 +0500 Subject: [erlang-questions] Incoming TCP connections are closed immediately, requiring SO_PRIORITY on newer Linux kernel Message-ID: Hello! I've met strange behaviour of RabbitMQ application on Linux kernel 4.14.46. Rabbit-users mailing list recommended ask here, probably it's Erlang's behaviour. Symptoms: Incoming TCP connections are established, and immediately closed. In strace (for /usr/lib/erlang/erts-10.0/bin/beam.smp process) there are failures setting SO_PRIORITY socket option: [pid 1814] accept(58, {sa_family=AF_INET, sin_port=htons(43054), sin_addr=inet_addr("127.0.0.1")}, [16]) = 13 [pid 1814] epoll_ctl(4, EPOLL_CTL_MOD, 58, {EPOLLONESHOT, {u32=58, u64=20331670804627514}}) = 0 [pid 1814] fcntl(13, F_GETFL) = 0x2 (flags O_RDWR) [pid 1814] fcntl(13, F_SETFL, O_RDWR|O_NONBLOCK) = 0 [pid 1814] getsockopt(58, SOL_TCP, TCP_NODELAY, [0], [4]) = 0 [pid 1814] getsockopt(58, SOL_SOCKET, SO_KEEPALIVE, [0], [4]) = 0 [pid 1814] getsockopt(58, SOL_SOCKET, SO_PRIORITY, [0], [4]) = 0 [pid 1814] getsockopt(58, SOL_IP, IP_TOS, [0], [4]) = 0 [pid 1814] getsockopt(13, SOL_SOCKET, SO_PRIORITY, [0], [4]) = 0 [pid 1814] getsockopt(13, SOL_IP, IP_TOS, [0], [4]) = 0 [pid 1814] setsockopt(13, SOL_IP, IP_TOS, [0], 4) = 0 [pid 1814] setsockopt(13, SOL_SOCKET, SO_PRIORITY, [0], 4) = -1 EPERM (Operation not permitted) [pid 1814] getsockopt(13, SOL_SOCKET, SO_PRIORITY, [0], [4]) = 0 [pid 1814] getsockopt(13, SOL_IP, IP_TOS, [0], [4]) = 0 [pid 1814] setsockopt(13, SOL_SOCKET, SO_PRIORITY, [0], 4) = -1 EPERM (Operation not permitted) [pid 1814] getsockopt(13, SOL_SOCKET, SO_LINGER, {onoff=0, linger=0}, [8]) = 0 [pid 1814] close(13) = 0 With older Linux kernel (4.9.86), connections work well works fine: [pid 1665] accept(58, {sa_family=AF_INET, sin_port=htons(48170), sin_addr=inet_addr("127.0.0.1")}, [16]) = 12 [pid 1665] epoll_ctl(4, EPOLL_CTL_MOD, 58, {EPOLLONESHOT, {u32=58, u64=20331670804627514}}) = 0 [pid 1665] fcntl(12, F_GETFL) = 0x2 (flags O_RDWR) [pid 1665] fcntl(12, F_SETFL, O_RDWR|O_NONBLOCK) = 0 [pid 1665] getsockopt(58, SOL_TCP, TCP_NODELAY, [0], [4]) = 0 [pid 1665] getsockopt(58, SOL_SOCKET, SO_KEEPALIVE, [0], [4]) = 0 [pid 1665] getsockopt(58, SOL_SOCKET, SO_PRIORITY, [0], [4]) = 0 [pid 1665] getsockopt(58, SOL_IP, IP_TOS, [0], [4]) = 0 [pid 1665] getsockopt(12, SOL_SOCKET, SO_PRIORITY, [0], [4]) = 0 [pid 1665] getsockopt(12, SOL_IP, IP_TOS, [0], [4]) = 0 [pid 1665] setsockopt(12, SOL_IP, IP_TOS, [0], 4) = 0 [pid 1665] setsockopt(12, SOL_SOCKET, SO_PRIORITY, [0], 4) = 0 [pid 1665] getsockopt(12, SOL_SOCKET, SO_PRIORITY, [0], [4]) = 0 [pid 1665] getsockopt(12, SOL_IP, IP_TOS, [0], [4]) = 0 [pid 1665] setsockopt(12, SOL_SOCKET, SO_PRIORITY, [0], 4) = 0 [pid 1665] getsockopt(12, SOL_SOCKET, SO_PRIORITY, [0], [4]) = 0 [pid 1665] getsockopt(12, SOL_IP, IP_TOS, [0], [4]) = 0 [pid 1665] setsockopt(12, SOL_SOCKET, SO_KEEPALIVE, [0], 4) = 0 [pid 1665] setsockopt(12, SOL_IP, IP_TOS, [0], 4) = 0 [pid 1665] setsockopt(12, SOL_SOCKET, SO_PRIORITY, [0], 4) = 0 [pid 1665] getsockopt(12, SOL_SOCKET, SO_PRIORITY, [0], [4]) = 0 [pid 1665] getsockopt(12, SOL_IP, IP_TOS, [0], [4]) = 0 [pid 1665] setsockopt(12, SOL_TCP, TCP_NODELAY, [0], 4) = 0 [pid 1665] setsockopt(12, SOL_SOCKET, SO_PRIORITY, [0], 4) = 0 [pid 1665] getsockopt(58, SOL_IPV6, IPV6_TCLASS, 0x7f88c14fc7c8, 0x7f88c14fc7cc) = -1 EOPNOTSUPP (Operation not supported) [pid 1665] accept(58, 0x7f88c14feaf0, 0x7f88c14feac4) = -1 EAGAIN (Resource temporarily unavailable) [pid 1665] epoll_ctl(4, EPOLL_CTL_MOD, 58, {EPOLLIN|EPOLLONESHOT, {u32=58, u64=14125640596043333690}}) = 0 [pid 1665] recvfrom(12, 0x7f88c43489e8, 1460, 0, NULL, NULL) = -1 EAGAIN (Resource temporarily unavailable) [pid 1665] epoll_ctl(4, EPOLL_CTL_ADD, 12, {EPOLLIN|EPOLLONESHOT, {u32=12, u64=14125640596043333644}}) = 0 [pid 1665] futex(0x7f88c3f811d0, FUTEX_WAIT_PRIVATE, 4294967295, {0, 151060429}) = -1 ETIMEDOUT (Connection timed out) [pid 1665] futex(0x7f88c3f811d0, FUTEX_WAKE_PRIVATE, 1) = 0 [pid 1665] futex(0x7f88c3f813d0, FUTEX_WAKE_PRIVATE, 1 Setting these capabilities explicitly (setcap cap_net_admin+ep /usr/lib/erlang/erts-10.0/bin/beam.smp) makes RabbitMQ to work again (TCP connections are not closed any more). Could you please help? Why does this problem occur? Erlang version is 21 (latest): # erl -sname test Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] Eshell V10.0 (abort with ^G) RabbitMQ version: 3.7.7-1 (latest). -- Best Regards, Dmitry Simonov -------------- next part -------------- An HTML attachment was scrubbed... URL: From essen@REDACTED Wed Jul 18 08:08:50 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Wed, 18 Jul 2018 08:08:50 +0200 Subject: [erlang-questions] Cowboy serve static files [video file] can not fast forward In-Reply-To: References: Message-ID: <86c20f2c-0f05-62a9-e574-dd4ebea7e690@ninenines.eu> If I recall that's because the static files handler does not support range requests yet. On 07/18/2018 05:21 AM, by wrote: > Hi, > > I am trying to serve a static website via Cowboy, and I followed the guide, it seems works fine. > > The problem is that the static website has a mp4 file, and I play the video on web page. > It can play, but when I try to click the progress bar to do fast forward, it keeps play on the normal way(not work). > > Do I need add some other configurations for this? > > Same static files works fine with nginx. > > Thanks, > Yao Bao > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From max.lapshin@REDACTED Wed Jul 18 08:21:14 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 18 Jul 2018 09:21:14 +0300 Subject: [erlang-questions] Cowboy serve static files [video file] can not fast forward In-Reply-To: <86c20f2c-0f05-62a9-e574-dd4ebea7e690@ninenines.eu> References: <86c20f2c-0f05-62a9-e574-dd4ebea7e690@ninenines.eu> Message-ID: Rather easy to add trivial implementation of Range (I do not even want to speak about horror with byte numbering in spec =((( ), but full implementation that will not kill server may be much bigger and harder work. Cowboy itself is as fast as nginx and can serve video from disk on wire speed, so small fix and all will be ok. -------------- next part -------------- An HTML attachment was scrubbed... URL: From by@REDACTED Wed Jul 18 08:28:57 2018 From: by@REDACTED (by) Date: Wed, 18 Jul 2018 14:28:57 +0800 Subject: [erlang-questions] Cowboy serve static files [video file] can not fast forward In-Reply-To: <86c20f2c-0f05-62a9-e574-dd4ebea7e690@ninenines.eu> References: <86c20f2c-0f05-62a9-e574-dd4ebea7e690@ninenines.eu> Message-ID: Well, I see. Is there any existing resolution about this? Maybe third party handler? I believe the requirements for serving video liked content is very common. > ? 2018?7?18??14:08?Lo?c Hoguin ??? > > If I recall that's because the static files handler does not support range requests yet. > > On 07/18/2018 05:21 AM, by wrote: >> Hi, >> I am trying to serve a static website via Cowboy, and I followed the guide, it seems works fine. >> The problem is that the static website has a mp4 file, and I play the video on web page. >> It can play, but when I try to click the progress bar to do fast forward, it keeps play on the normal way(not work). >> Do I need add some other configurations for this? >> Same static files works fine with nginx. >> Thanks, >> Yao Bao >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions > > -- > Lo?c Hoguin > https://ninenines.eu From pierrefenoll@REDACTED Wed Jul 18 09:49:19 2018 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Wed, 18 Jul 2018 09:49:19 +0200 Subject: [erlang-questions] Cowboy serve static files [video file] can not fast forward In-Reply-To: References: <86c20f2c-0f05-62a9-e574-dd4ebea7e690@ninenines.eu> Message-ID: I believe you can create a bounty / pay Lo?c to implement this & share it with the whole world. I'd gladly follow suit. Cheers, -- Pierre Fenoll On Wed, 18 Jul 2018 at 08:36, by wrote: > Well, I see. > Is there any existing resolution about this? Maybe third party handler? > I believe the requirements for serving video liked content is very common. > > > ? 2018?7?18??14:08?Lo?c Hoguin ??? > > > > If I recall that's because the static files handler does not support > range requests yet. > > > > On 07/18/2018 05:21 AM, by wrote: > >> Hi, > >> I am trying to serve a static website via Cowboy, and I followed the > guide, it seems works fine. > >> The problem is that the static website has a mp4 file, and I play the > video on web page. > >> It can play, but when I try to click the progress bar to do fast > forward, it keeps play on the normal way(not work). > >> Do I need add some other configurations for this? > >> Same static files works fine with nginx. > >> Thanks, > >> Yao Bao > >> _______________________________________________ > >> erlang-questions mailing list > >> erlang-questions@REDACTED > >> http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > > Lo?c Hoguin > > https://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 bob@REDACTED Wed Jul 18 09:58:57 2018 From: bob@REDACTED (Bob Ippolito) Date: Tue, 17 Jul 2018 23:58:57 -0800 Subject: [erlang-questions] Cowboy serve static files [video file] can not fast forward In-Reply-To: References: <86c20f2c-0f05-62a9-e574-dd4ebea7e690@ninenines.eu> Message-ID: And if you?re looking for a starting point, other Erlang web servers implement this feature, so you should be able to copy and paste most of an implementation. I know mochiweb has it for sure, but yaws or inets may also implement range requests. On Tue, Jul 17, 2018 at 23:50 Pierre Fenoll wrote: > I believe you can create a bounty / pay Lo?c to implement this & share it > with the whole world. > I'd gladly follow suit. > > Cheers, > -- > Pierre Fenoll > > On Wed, 18 Jul 2018 at 08:36, by wrote: > >> Well, I see. >> Is there any existing resolution about this? Maybe third party handler? >> I believe the requirements for serving video liked content is very common. >> >> > ? 2018?7?18??14:08?Lo?c Hoguin ??? >> > >> > If I recall that's because the static files handler does not support >> range requests yet. >> > >> > On 07/18/2018 05:21 AM, by wrote: >> >> Hi, >> >> I am trying to serve a static website via Cowboy, and I followed the >> guide, it seems works fine. >> >> The problem is that the static website has a mp4 file, and I play the >> video on web page. >> >> It can play, but when I try to click the progress bar to do fast >> forward, it keeps play on the normal way(not work). >> >> Do I need add some other configurations for this? >> >> Same static files works fine with nginx. >> >> Thanks, >> >> Yao Bao >> >> _______________________________________________ >> >> erlang-questions mailing list >> >> erlang-questions@REDACTED >> >> http://erlang.org/mailman/listinfo/erlang-questions >> > >> > -- >> > Lo?c Hoguin >> > https://ninenines.eu >> >> _______________________________________________ >> 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 Jul 18 09:59:59 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Wed, 18 Jul 2018 09:59:59 +0200 Subject: [erlang-questions] Cowboy serve static files [video file] can not fast forward In-Reply-To: References: <86c20f2c-0f05-62a9-e574-dd4ebea7e690@ninenines.eu> Message-ID: Someone did a partial implementation for cowboy_rest here: https://github.com/ninenines/cowboy/pull/1059 But you'll have to make your own handler (or a wrapper of cowboy_static). Adding proper support is currently not prioritized, it's not been necessary for customers yet and I still have a few more important tasks to do (better Websocket, better cookies, and CORS support being the next big three, and of course Ranch 2.0). On 07/18/2018 08:28 AM, by wrote: > Well, I see. > Is there any existing resolution about this? Maybe third party handler? > I believe the requirements for serving video liked content is very common. > >> ? 2018?7?18??14:08?Lo?c Hoguin ??? >> >> If I recall that's because the static files handler does not support range requests yet. >> >> On 07/18/2018 05:21 AM, by wrote: >>> Hi, >>> I am trying to serve a static website via Cowboy, and I followed the guide, it seems works fine. >>> The problem is that the static website has a mp4 file, and I play the video on web page. >>> It can play, but when I try to click the progress bar to do fast forward, it keeps play on the normal way(not work). >>> Do I need add some other configurations for this? >>> Same static files works fine with nginx. >>> Thanks, >>> Yao Bao >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >> >> -- >> Lo?c Hoguin >> https://ninenines.eu > -- Lo?c Hoguin https://ninenines.eu From by@REDACTED Wed Jul 18 10:06:52 2018 From: by@REDACTED (by) Date: Wed, 18 Jul 2018 16:06:52 +0800 Subject: [erlang-questions] Cowboy serve static files [video file] can not fast forward In-Reply-To: References: <86c20f2c-0f05-62a9-e574-dd4ebea7e690@ninenines.eu> Message-ID: <24847A38-A907-4520-A189-023C0C944CB1@meetlost.com> OK I will try cowboy_rest. Thanks > ? 2018?7?18??15:59?Lo?c Hoguin ??? > > Someone did a partial implementation for cowboy_rest here: https://github.com/ninenines/cowboy/pull/1059 > > But you'll have to make your own handler (or a wrapper of cowboy_static). > > Adding proper support is currently not prioritized, it's not been necessary for customers yet and I still have a few more important tasks to do (better Websocket, better cookies, and CORS support being the next big three, and of course Ranch 2.0). > > On 07/18/2018 08:28 AM, by wrote: >> Well, I see. >> Is there any existing resolution about this? Maybe third party handler? >> I believe the requirements for serving video liked content is very common. >>> ? 2018?7?18??14:08?Lo?c Hoguin ??? >>> >>> If I recall that's because the static files handler does not support range requests yet. >>> >>> On 07/18/2018 05:21 AM, by wrote: >>>> Hi, >>>> I am trying to serve a static website via Cowboy, and I followed the guide, it seems works fine. >>>> The problem is that the static website has a mp4 file, and I play the video on web page. >>>> It can play, but when I try to click the progress bar to do fast forward, it keeps play on the normal way(not work). >>>> Do I need add some other configurations for this? >>>> Same static files works fine with nginx. >>>> Thanks, >>>> Yao Bao >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> -- >>> Lo?c Hoguin >>> https://ninenines.eu > > -- > Lo?c Hoguin > https://ninenines.eu From marc@REDACTED Wed Jul 18 11:16:21 2018 From: marc@REDACTED (Marc Worrell) Date: Wed, 18 Jul 2018 11:16:21 +0200 Subject: [erlang-questions] Cowboy serve static files [video file] can not fast forward In-Reply-To: <24847A38-A907-4520-A189-023C0C944CB1@meetlost.com> References: <86c20f2c-0f05-62a9-e574-dd4ebea7e690@ninenines.eu> <24847A38-A907-4520-A189-023C0C944CB1@meetlost.com> Message-ID: <9FA20EE7-0E2A-4172-9F16-DBF599761643@worrell.nl> We (Zotonic) also implemented range requests in cowmachine. https://github.com/zotonic/cowmachine/blob/master/src/cowmachine_response.erl#L72 Cowmachine is the Webmachine variant for the new version of Zotonic. It uses Cowboy instead of Mochiweb, and simplified the controller callbacks. - Marc > On 18 Jul 2018, at 10:06, by wrote: > > OK > I will try cowboy_rest. > Thanks > >> ? 2018?7?18??15:59?Lo?c Hoguin ??? >> >> Someone did a partial implementation for cowboy_rest here: https://github.com/ninenines/cowboy/pull/1059 >> >> But you'll have to make your own handler (or a wrapper of cowboy_static). >> >> Adding proper support is currently not prioritized, it's not been necessary for customers yet and I still have a few more important tasks to do (better Websocket, better cookies, and CORS support being the next big three, and of course Ranch 2.0). >> >> On 07/18/2018 08:28 AM, by wrote: >>> Well, I see. >>> Is there any existing resolution about this? Maybe third party handler? >>> I believe the requirements for serving video liked content is very common. >>>> ? 2018?7?18??14:08?Lo?c Hoguin ??? >>>> >>>> If I recall that's because the static files handler does not support range requests yet. >>>> >>>> On 07/18/2018 05:21 AM, by wrote: >>>>> Hi, >>>>> I am trying to serve a static website via Cowboy, and I followed the guide, it seems works fine. >>>>> The problem is that the static website has a mp4 file, and I play the video on web page. >>>>> It can play, but when I try to click the progress bar to do fast forward, it keeps play on the normal way(not work). >>>>> Do I need add some other configurations for this? >>>>> Same static files works fine with nginx. >>>>> Thanks, >>>>> Yao Bao >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> -- >>>> Lo?c Hoguin >>>> https://ninenines.eu >> >> -- >> Lo?c Hoguin >> https://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 z@REDACTED Wed Jul 18 11:28:10 2018 From: z@REDACTED (Danil Zagoskin) Date: Wed, 18 Jul 2018 12:28:10 +0300 Subject: [erlang-questions] How to pin-point High CPU utilization in Erlang VM In-Reply-To: References: Message-ID: Hi! I know that feel when a load is very high and you don't know why. More things to see: * extended msacc: configure OTP with --with-microstate-accounting=extra * LCNT: lcnt:apply(timer, sleep, [5000]), lcnt:conflicts(), lcnt:inspect, etc. * Check if there are some processes spending too much time running. You may find this tool useful: https://gist.github.com/stolen/9a28ed9403c724541b0ee5fcd822613e * network buffers. Check if rmem/wmem in sysctl are the same. Also check network interfaces ? MTU, drops, etc. * NUMA and scheduler bindings. Try running the whole application on single NUMA node to avoid interconnect cost * Other processes on the host. Once we saw a malware miner that hid itself from ps and was active only when the server was busy doing its main job. Use perf top on the every CPU core to detect this. On Wed, Jul 18, 2018 at 6:34 AM Marcial Rosales wrote: > We are experiencing a very high cpu utilization in 3 clustered Erlang VMs > running RabbitMQ. We have deployed another cluster in an attempt to > reproduce the same behaviour without much success. > > Our goals are: > > - Find out where the CPU is being utilized > - Choose the right tools to analyze CPU utilization > > > Our observations so far: > > - The *BAD* cluster observes a pretty excessive CPU utilization, both > user and system ones, and also network. > - The *BAD* cluster also observes a higher Erlang scheduler > utilization, specially on microstate emulator and other. We are yet to > understand what other could be. According to Erlang documentation is *unaccounted > things*. > - The *BAD* cluster observes a considerably higher number of system > calls which we are yet to identify (dunno how) why is that. > - The *BAD* cluster does not necessarily run higher number of > reductions. In fact, the *GOOD* cluster runs more reductions and yet > has a lower scheduler utilization. > > METRICBADGOOD > user cpu > 46% > - 57% 19% - 40% > system cpu > 20% > - 37% 1% - 10% > network traffic > 6M > - 19M up to 8M > system interrupts > 120k > - 196k 10k - 20k > syscalls > 1.6M > - 2.1M 49k - 110k > task-clock 10sec > > 68255 12324 > cpu profiling info > > > We have gathered lots of metrics in attempt to identify why the BAD > cluster uses so much CPU. All the information can be found here > https://gist.github.com/MarcialRosales/226716f0cb9e27cd9ab02eac04702841 > along with the environment information. > > > We appreciate a lot any insights as to what could be causing the issue > and/or in relation to additional tools we could use. > Many thanks > > -- > Marcial Rosales > Pivotal, Inc. EMEA > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From rickard@REDACTED Wed Jul 18 14:47:58 2018 From: rickard@REDACTED (Rickard Green) Date: Wed, 18 Jul 2018 14:47:58 +0200 Subject: [erlang-questions] Patch Package CORBA 4.5.2 Released Message-ID: Patch Package: CORBA 4.5.2 Git Tag: 4.5.2 Date: 2018-07-18 Trouble Report Id: OTP-15197 Seq num: ERIERL-202 System: CORBA Application: corba-4.5.2 Predecessor: CORBA 4.5.1 --------------------------------------------------------------------- --- corba-4.5.1 ----------------------------------------------------- --------------------------------------------------------------------- --- Fixed Bugs and Malfunctions --- OTP-15197 Related Id(s): OTP-15177, ERIERL-202 Fixed install for IC. Headers, libraries, and IDL files are now installed under $RELEASE_ROOT/usr regardless of type of install. --------------------------------------------------------------------- --------------------------------------------------------------------- --------------------------------------------------------------------- From ebegumisa@REDACTED Wed Jul 18 23:53:06 2018 From: ebegumisa@REDACTED (Edmond Begumisa) Date: Thu, 19 Jul 2018 07:53:06 +1000 Subject: [erlang-questions] Dispcount resource identification during init Message-ID: Hello all, Any dispcount[1] users out there? Your assistance on two questions would be appreciated.. a) During init function of the callback module implementing the dispcount behaviour, I would like to know resource number assigned to that process. Is this possible? The reason is: each of my resources (port programs) need to be initialised to use separate directories for storage. For example: "priv/rc1/data", "priv/rc2/data", etc. If the dispcount sup restarts resource 1 for instance, I would like resource 1 to always use "priv/rc1/data". There should be no possibility two or more resources ending up being initialised to the same dir due to sup restarts. The identifier doesn't have to be a number. But if the node/machine restarts, the same directories should be used. b) Is this library still active? One feature mentioned on the todo list would be nice to have for our purposes (dynamically growing/shrinking the number of resources). Thanks in advance. - Edmond - [1] https://github.com/ferd/dispcount -- Using Opera's mail client: http://www.opera.com/mail/ From mononcqc@REDACTED Thu Jul 19 01:17:13 2018 From: mononcqc@REDACTED (Fred Hebert) Date: Wed, 18 Jul 2018 19:17:13 -0400 Subject: [erlang-questions] Dispcount resource identification during init In-Reply-To: References: Message-ID: <20180718231711.GA77839@ferdmbp.local> On 07/19, Edmond Begumisa wrote: >Hello all, > >Any dispcount[1] users out there? Your assistance on two questions >would be appreciated.. > >a) During init function of the callback module implementing the >dispcount behaviour, I would like to know resource number assigned to >that process. Is this possible? > Each process registers itself, so you should be able to find that information from process_info(self()). Otherwise, nothing is passed explicitly to the callback. I'm figuring this might be enough to get going. >b) Is this library still active? One feature mentioned on the todo list >would be nice to have for our purposes (dynamically growing/shrinking >the number of resources). > It is, for all intents and purposes, a complete library. There has not been bug reports nor feature requests, so it is stable. If someone were to report bugs, I would probably try and fix them, but it's been pretty calm and stable for the last 4 years. I haven't used or tried to use it (my work has moved to systems with different requirements) recently, but I'm still fine maintaining it. If someone has a plan to improve the libs, I'd be fine handing control over, though. From ebegumisa@REDACTED Thu Jul 19 01:28:52 2018 From: ebegumisa@REDACTED (Edmond Begumisa) Date: Wed, 18 Jul 2018 16:28:52 -0700 Subject: [erlang-questions] Dispcount resource identification during init In-Reply-To: Message-ID: <1946abe730f20bbee399dfdf90e8fc116df0d42e@webmail.hysteria-tech.com> The following patch appears to do what I want. Perhaps those familiar with discount internals could confirm its correctness or suggest and alternative approach which doesn't require a patch. dispcount_watcher.erl ? ? ? ?? ... ? ?? ??? init (Id ,Conf ,M ,A ) -> ??? -???????? case M :init (A ) of ??? +???????? case M :init (Id, A ) of ??? ? ?? ... dispcount.erl ??? ? ?? ... ???????? behaviour_info(callbacks) -> ??? -???????? [{init,1}, ??? +??????? [{init,2}, ??? ? ?? ... - Edmond - ----- Original Message ----- From: To: "Edmond Begumisa" Cc: Send my REPLY [1] Sent: Thu, 19 Jul 2018 07:53:06 +1000 Subject: Dispcount resource identification during init Hello all, Any dispcount[1] users out there? Your assistance on two questions would be appreciated.. a) During init function of the callback module implementing the dispcount behaviour, I would like to know resource number assigned to that process. Is this possible? The reason is: each of my resources (port programs) need to be initialised to use separate directories for storage. For example: "priv/rc1/data", "priv/rc2/data", etc. If the dispcount sup restarts resource 1 for instance, I would like resource 1 to always use "priv/rc1/data". There should be no possibility two or more resources ending up being initialised to the same dir due to sup restarts. The identifier doesn't have to be a number. But if the node/machine restarts, the same directories should be used. b) Is this library still active? One feature mentioned on the todo list would be nice to have for our purposes (dynamically growing/shrinking the number of resources). Thanks in advance. - Edmond - [1] https://github.com/ferd/dispcount -- Using Opera's mail client: http://www.opera.com/mail/ Links: ------ [1] http://webmail.hysteria-tech.com/# -------------- next part -------------- An HTML attachment was scrubbed... URL: From ebegumisa@REDACTED Thu Jul 19 01:32:04 2018 From: ebegumisa@REDACTED (Edmond Begumisa) Date: Wed, 18 Jul 2018 16:32:04 -0700 Subject: [erlang-questions] Dispcount resource identification during init In-Reply-To: <20180718231711.GA77839@ferdmbp.local> Message-ID: <22525b8df946f1cf1928100ebc650f0024af0d55@webmail.hysteria-tech.com> Oh, We seem posted at the same time! Thanks for this. I'll give process_info(self()) a try. Good work with the library. Regards. - Edmond - ----- Original Message ----- From: "Fred Hebert" To:"Edmond Begumisa" Cc: Sent:Wed, 18 Jul 2018 19:17:13 -0400 Subject:Re: [erlang-questions] Dispcount resource identification during init On 07/19, Edmond Begumisa wrote: >Hello all, > >Any dispcount[1] users out there? Your assistance on two questions >would be appreciated.. > >a) During init function of the callback module implementing the >dispcount behaviour, I would like to know resource number assigned to >that process. Is this possible? > Each process registers itself, so you should be able to find that information from process_info(self()). Otherwise, nothing is passed explicitly to the callback. I'm figuring this might be enough to get going. >b) Is this library still active? One feature mentioned on the todo list >would be nice to have for our purposes (dynamically growing/shrinking >the number of resources). > It is, for all intents and purposes, a complete library. There has not been bug reports nor feature requests, so it is stable. If someone were to report bugs, I would probably try and fix them, but it's been pretty calm and stable for the last 4 years. I haven't used or tried to use it (my work has moved to systems with different requirements) recently, but I'm still fine maintaining it. If someone has a plan to improve the libs, I'd be fine handing control over, though. -------------- next part -------------- An HTML attachment was scrubbed... URL: From devon.c.estes@REDACTED Thu Jul 19 00:36:58 2018 From: devon.c.estes@REDACTED (Devon Estes) Date: Wed, 18 Jul 2018 15:36:58 -0700 Subject: [erlang-questions] Memory usage in OTP 21 Message-ID: Hey everyone, First off, I would like to apologize for the following code example in Elixir - it's the language I know best, and where we're having the problem. Anyway, I'm one of the maintainers of an Elixir benchmarking tool called Benchee. A few months ago we added memory measurement as a feature in our benchmarking tool. However, with the release of OTP 21, we're seeing some measurements that seem very strange. For example, according to our measurements, the following function uses 0 bytes of memory: `Enum.to_list(1..10)`. On OTP 20, this always uses between 350-380 byes depending on the platform. There are a few other instances of these kinds of functions which we believe should be using memory somewhere, but the results that we get back from our measurements say they are not using any memory, and all of them are around functions that in OTP 20 used very little memory. We are also seeing somewhat frequently what appears to be _negative_ net memory usage, which again seems really strange. So, is this some sort of optimization that we're missing, or is there somewhere else (maybe in a heap fragment?) that these structures might be stored? And if they are somewhere else, is it possible to measure this memory usage? At the moment we're measuring memory usage by using `erlang:trace/3` to listen to the garbage collection events, and calculate the used memory from there, and adding any remaining used memory on the heap at the end of the function (after the last GC run). Thanks again for any help y'all might be able to offer! -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Thu Jul 19 11:50:57 2018 From: lukas@REDACTED (Lukas Larsson) Date: Thu, 19 Jul 2018 11:50:57 +0200 Subject: [erlang-questions] How to pin-point High CPU utilization in Erlang VM In-Reply-To: References: Message-ID: Hello, On Wed, Jul 18, 2018 at 5:34 AM Marcial Rosales wrote: > We are experiencing a very high cpu utilization in 3 clustered Erlang VMs > running RabbitMQ. We have deployed another cluster in an attempt to > reproduce the same behaviour without much success. > > Our goals are: > > - Find out where the CPU is being utilized > - Choose the right tools to analyze CPU utilization > > > Our observations so far: > > - The *BAD* cluster observes a pretty excessive CPU utilization, both > user and system ones, and also network. > - The *BAD* cluster also observes a higher Erlang scheduler > utilization, specially on microstate emulator and other. We are yet to > understand what other could be. According to Erlang documentation is *unaccounted > things*. > > If you compile Erlang with "./configure --with-microstate-accounting=extra" (as suggested by Danil), the other part will be broken into more granular parts. However, looking at your perf recordings I would guess that most of the other time is time spent spinning before going to sleep. > > - The *BAD* cluster observes a considerably higher number of system > calls which we are yet to identify (dunno how) why is that. > > Maybe use strace and then write some small script that counts the different syscall made? > > - The *BAD* cluster does not necessarily run higher number of > reductions. In fact, the *GOOD* cluster runs more reductions and yet > has a lower scheduler utilization. > > METRICBADGOOD > user cpu > 46% > - 57% 19% - 40% > system cpu > 20% > - 37% 1% - 10% > network traffic > 6M > - 19M up to 8M > system interrupts > 120k > - 196k 10k - 20k > syscalls > 1.6M > - 2.1M 49k - 110k > task-clock 10sec > > 68255 12324 > cpu profiling info > > > We have gathered lots of metrics in attempt to identify why the BAD > cluster uses so much CPU. All the information can be found here > https://gist.github.com/MarcialRosales/226716f0cb9e27cd9ab02eac04702841 > along with the environment information. > > > In the BAD cluster, would it be possible to see the annotated versions of process_main and scheduler_wait in the "perf record" run? There doesn't seem to be any kernel symbols in the BAD cluster perf run, do you know why? > We appreciate a lot any insights as to what could be causing the issue > and/or in relation to additional tools we could use. > My gut tells me that there is some syscall that is a lot slower on XEN than it is in the KVM. In virtualized environments I always tend to suspect the time source first. Different hypervisors have very different performance for getting the time and the Erlang VM does a lot of time fetching. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrosales@REDACTED Thu Jul 19 12:02:54 2018 From: mrosales@REDACTED (Marcial Rosales) Date: Thu, 19 Jul 2018 12:02:54 +0200 Subject: [erlang-questions] How to pin-point High CPU utilization in Erlang VM In-Reply-To: References: Message-ID: Hi Danil ! Thank you very much for the suggestions. For the time being, we can't change the Bad cluster with a new erlang with the extended msacc and lcnt. But in the good cluster we have lcnt enabled and we are going to enable msacc. Although we wont have anything to compare against. We'll report back any findings with regards the other suggestions very soon. Thanks ! On Wed, Jul 18, 2018 at 11:28 AM Danil Zagoskin wrote: > Hi! > > I know that feel when a load is very high and you don't know why. > > More things to see: > * extended msacc: configure OTP with --with-microstate-accounting=extra > * LCNT: lcnt:apply(timer, sleep, [5000]), lcnt:conflicts(), lcnt:inspect, > etc. > * Check if there are some processes spending too much time running. You > may find this tool useful: > https://gist.github.com/stolen/9a28ed9403c724541b0ee5fcd822613e > * network buffers. Check if rmem/wmem in sysctl are the same. Also check > network interfaces ? MTU, drops, etc. > * NUMA and scheduler bindings. Try running the whole application on single > NUMA node to avoid interconnect cost > * Other processes on the host. Once we saw a malware miner that hid itself > from ps and was active only when the server was busy doing its main job. > Use perf top on the every CPU core to detect this. > > > On Wed, Jul 18, 2018 at 6:34 AM Marcial Rosales > wrote: > >> We are experiencing a very high cpu utilization in 3 clustered Erlang VMs >> running RabbitMQ. We have deployed another cluster in an attempt to >> reproduce the same behaviour without much success. >> >> Our goals are: >> >> - Find out where the CPU is being utilized >> - Choose the right tools to analyze CPU utilization >> >> >> Our observations so far: >> >> - The *BAD* cluster observes a pretty excessive CPU utilization, both >> user and system ones, and also network. >> - The *BAD* cluster also observes a higher Erlang scheduler >> utilization, specially on microstate emulator and other. We are yet >> to understand what other could be. According to Erlang documentation >> is *unaccounted things*. >> - The *BAD* cluster observes a considerably higher number of system >> calls which we are yet to identify (dunno how) why is that. >> - The *BAD* cluster does not necessarily run higher number of >> reductions. In fact, the *GOOD* cluster runs more reductions and yet >> has a lower scheduler utilization. >> >> METRICBADGOOD >> user cpu >> 46% >> - 57% 19% - 40% >> system cpu >> 20% >> - 37% 1% - 10% >> network traffic >> 6M >> - 19M up to 8M >> system interrupts >> 120k >> - 196k 10k - 20k >> syscalls >> 1.6M >> - 2.1M 49k - 110k >> task-clock 10sec >> >> 68255 12324 >> cpu profiling info >> >> >> We have gathered lots of metrics in attempt to identify why the BAD >> cluster uses so much CPU. All the information can be found here >> https://gist.github.com/MarcialRosales/226716f0cb9e27cd9ab02eac04702841 >> along with the environment information. >> >> >> We appreciate a lot any insights as to what could be causing the issue >> and/or in relation to additional tools we could use. >> Many thanks >> >> -- >> Marcial Rosales >> Pivotal, Inc. EMEA >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > > > -- > Danil Zagoskin | z@REDACTED > -- Marcial Rosales Advisory Solution Architect (Customer Success Organization) Pivotal, Inc. EMEA -------------- next part -------------- An HTML attachment was scrubbed... URL: From attila.r.nohl@REDACTED Thu Jul 19 15:47:28 2018 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Thu, 19 Jul 2018 15:47:28 +0200 Subject: [erlang-questions] coverage tests In-Reply-To: References: Message-ID: Hello! Is it possible to pass these arguments from rebar3 to cover? Dmitry Kolesnikov ezt ?rta (id?pont: 2018. m?rc. 28., Sze, 13:47): > > Hello, > > Yes, it is possible. > > You can specify in cover.spec a list of projects for coverage analysis > ``` > {level, details}. > {incl_dirs, [ > "../_build/default/lib/app-a/ebin", > "../_build/default/lib/app-b/ebin" > ]}. > ``` > > Basically, use your test app to orchestrate testing of your main application. > > Best Regards, > Dmitry > > > > On 28 Mar 2018, at 14.42, Caragea Silviu wrote: > > > > Hello, > > > > I have an app that's using a HTTP interface in order to expose the functionality. > > > > Also I have another project which implements functionality tests for the first app by running all kind of HTTP requests and compare the results with the expected one. > > > > My question is: there is any way to generate also a coverage test report for the app that's exposing the HTTP server ? to see how much of the code my tests is touching ? > > > > I looked over ct_run but most examples and user cases doesn't involve two different apps. > > > > Silviu > > _______________________________________________ > > 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 jesper.louis.andersen@REDACTED Thu Jul 19 17:28:32 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Thu, 19 Jul 2018 17:28:32 +0200 Subject: [erlang-questions] Memory usage in OTP 21 In-Reply-To: References: Message-ID: I'm pretty sure that's not it, but a function such as Enum.to_list(1..10) contains an enumeration which is a constant and to_list can be unfolded to produce [1, ..., 10]. Since that is a constant it ends up as a literal in the beam bytecode and thus it never ever generates any garbage when called. I'm pretty sure that Erlang compiler is not smart enough to make this unfolding, but it doesn't take a lot of work to make a compiler constant fold such a case. Especially if it is common in code since compiler developers tend to target that. Another common trick is if escape analysis shows the result doesn't outlive its scope in which case data can be stack-allocated, making it far more unlikely to produce heap bump allocation and thus trigger the GC. This assumption can be verifed by disassembly of the beam bytecode and looking for what the system is doing. The negative allocation sounds strange to me though. That warrants investigation in what the trace calls are returning IMO to verify it happens at that level or lower. On Thu, Jul 19, 2018 at 7:42 AM Devon Estes wrote: > Hey everyone, > > First off, I would like to apologize for the following code example in > Elixir - it's the language I know best, and where we're having the problem. > > Anyway, I'm one of the maintainers of an Elixir benchmarking tool called > Benchee. A few months ago we added memory measurement as a feature in our > benchmarking tool. However, with the release of OTP 21, we're seeing some > measurements that seem very strange. For example, according to our > measurements, the following function uses 0 bytes of memory: > `Enum.to_list(1..10)`. On OTP 20, this always uses between 350-380 byes > depending on the platform. There are a few other instances of these kinds > of functions which we believe should be using memory somewhere, but the > results that we get back from our measurements say they are not using any > memory, and all of them are around functions that in OTP 20 used very > little memory. We are also seeing somewhat frequently what appears to be > _negative_ net memory usage, which again seems really strange. > > So, is this some sort of optimization that we're missing, or is there > somewhere else (maybe in a heap fragment?) that these structures might be > stored? And if they are somewhere else, is it possible to measure this > memory usage? > > At the moment we're measuring memory usage by using `erlang:trace/3` to > listen to the garbage collection events, and calculate the used memory from > there, and adding any remaining used memory on the heap at the end of the > function (after the last GC run). > > Thanks again for any help y'all might be able to offer! > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Fri Jul 20 09:39:18 2018 From: lukas@REDACTED (Lukas Larsson) Date: Fri, 20 Jul 2018 09:39:18 +0200 Subject: [erlang-questions] Memory usage in OTP 21 In-Reply-To: References: Message-ID: Hello, On Thu, Jul 19, 2018 at 7:42 AM Devon Estes wrote: > Hey everyone, > > First off, I would like to apologize for the following code example in > Elixir - it's the language I know best, and where we're having the problem. > > Anyway, I'm one of the maintainers of an Elixir benchmarking tool called > Benchee. A few months ago we added memory measurement as a feature in our > benchmarking tool. However, with the release of OTP 21, we're seeing some > measurements that seem very strange. For example, according to our > measurements, the following function uses 0 bytes of memory: > `Enum.to_list(1..10)`. On OTP 20, this always uses between 350-380 byes > depending on the platform. There are a few other instances of these kinds > of functions which we believe should be using memory somewhere, but the > results that we get back from our measurements say they are not using any > memory, and all of them are around functions that in OTP 20 used very > little memory. We are also seeing somewhat frequently what appears to be > _negative_ net memory usage, which again seems really strange. > > So, is this some sort of optimization that we're missing, or is there > somewhere else (maybe in a heap fragment?) that these structures might be > stored? And if they are somewhere else, is it possible to measure this > memory usage? > > At the moment we're measuring memory usage by using `erlang:trace/3` to > listen to the garbage collection events, and calculate the used memory from > there, and adding any remaining used memory on the heap at the end of the > function (after the last GC run). > Could you please provide a minimal example showcasing the behaviour? I can't think of any optimization done that would explain the change in behaviour. One thing that you could try is to compile the code using OTP 20 and run in on OTP 21. That way we'll know if it is the compiler that has gotten better, or if the run-time somehow is responsible for the change. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From kuna.prime@REDACTED Fri Jul 20 22:25:34 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Fri, 20 Jul 2018 22:25:34 +0200 Subject: [erlang-questions] returning bindins from file:script Message-ID: i am currently working on "file fold" module. files are erlang scripts (as input to file:script/2) and i want to pass bindings structure form one call of file:script/2 to another adding to it as scripts are evaluated. does anyone have elegant solution for this? or at least idea how to do it (except making alternative to file:script) thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From erlang@REDACTED Sat Jul 21 11:42:00 2018 From: erlang@REDACTED (Joe Armstrong) Date: Sat, 21 Jul 2018 11:42:00 +0200 Subject: [erlang-questions] returning bindins from file:script In-Reply-To: References: Message-ID: I suggest you read the source of file.erl - and in particular the routine eval_stream2/6 - this returns {ok, Val} so you loose the bindings change this is {ok,Val,Bindings} and use these when you process the next file. If you read the code in file.erl and look at file:eval(File) You see that basically only three routines are involved: erl_eval:new_bindings/0 - creates the initial bindings io:parse_erl_expressions/3 - parses the input data erl_eval:exprs/2 - evaluates a sequence of parsed expressions The module erl_eval does all the hard work for you Cheers /Joe On Fri, Jul 20, 2018 at 10:25 PM, Karlo Kuna wrote: > i am currently working on "file fold" module. > files are erlang scripts (as input to file:script/2) and i want to pass > bindings structure form one call of file:script/2 to another adding to it as > scripts are evaluated. > > does anyone have elegant solution for this? or at least idea how to do it > (except > making alternative to file:script) > > thanks > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From pragtob@REDACTED Sat Jul 21 12:45:07 2018 From: pragtob@REDACTED (Tobias Pfeiffer) Date: Sat, 21 Jul 2018 12:45:07 +0200 Subject: [erlang-questions] Memory usage in OTP 21 In-Reply-To: References: Message-ID: <953b1a28-e8e4-706f-8af7-412efc4320f0@gmail.com> Hi there and thank you for your help! I already disassembled it to make sure it's not inlined (I had this with another benchmark) and it's not: {:function, :test, 0, 10, [ {:label, 9}, {:line, [{:location, 'nofile', 2}]}, {:func_info, {:atom, Test}, {:atom, :test}, 0}, {:label, 10}, {:move, {:literal, 1..10}, {:x, 0}}, {:line, [{:location, 'nofile', 3}]}, {:call_ext_only, 1, {:extfunc, Enum, :to_list, 1}} ]}, Disassembled with this code: https://github.com/PragTob/elixir_playground/blob/master/lib/asm.ex I'll try to give some more background information on the problem we have in the coming days. Dank you everyone! Tobi On 07/19/2018 05:28 PM, Jesper Louis Andersen wrote: > I'm pretty sure that's not it, but a function such as > > Enum.to_list(1..10) > > contains an enumeration which is a constant and to_list can be unfolded > to produce [1, ..., 10]. > > Since that is a constant it ends up as a literal in the beam bytecode > and thus it never ever generates any garbage when called. I'm pretty > sure that Erlang compiler is not smart enough to make this unfolding, > but it doesn't take a lot of work to make a compiler constant fold such > a case. Especially if it is common in code since compiler developers > tend to target that. Another common trick is if escape analysis shows > the result doesn't outlive its scope in which case data can be > stack-allocated, making it far more unlikely to produce heap bump > allocation and thus trigger the GC. > > This assumption can be verifed by disassembly of the beam bytecode and > looking for what the system is doing. > > The negative allocation sounds strange to me though. That warrants > investigation in what the trace calls are returning IMO to verify it > happens at that level or lower. > > On Thu, Jul 19, 2018 at 7:42 AM Devon Estes > wrote: > > Hey everyone, > > First off, I would like to apologize for the following code example > in Elixir - it's the language I know best, and where we're having > the problem. > > Anyway, I'm one of the maintainers of an Elixir benchmarking tool > called Benchee. A few months ago we added memory measurement as a > feature in our benchmarking tool. However, with the release of OTP > 21, we're seeing some measurements that seem very strange. For > example, according to our measurements, the following function uses > 0 bytes of memory: `Enum.to_list(1..10)`. On OTP 20, this always > uses between 350-380 byes depending on the platform. There are a few > other instances of these kinds of functions which we believe should > be using memory somewhere, but the results that we get back from our > measurements say they are not using any memory, and all of them are > around functions that in OTP 20 used very little memory. We are also > seeing somewhat frequently what appears to be _negative_ net memory > usage, which again seems really strange. > > So, is this some sort of optimization that we're missing, or is > there somewhere else (maybe in a heap fragment?) that these > structures might be stored? And if they are somewhere else, is it > possible to measure this memory usage? > > At the moment we're measuring memory usage by using `erlang:trace/3` > to listen to the garbage collection events, and calculate the used > memory from there, and adding any remaining used memory on the heap > at the end of the function (after the last GC run). > > Thanks again for any help y'all might be able to offer! > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > J. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- http://www.pragtob.info/ From viktor@REDACTED Sun Jul 22 14:25:00 2018 From: viktor@REDACTED (=?UTF-8?Q?Viktor_S=c3=b6derqvist?=) Date: Sun, 22 Jul 2018 14:25:00 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case Message-ID: Hey everyone, I've seen these short-circuit operators with a non-boolean second operand, usually where the second operand is doing some side-effect and the return value is not important. It seems to be a trend. Example: Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), I this good or bad style? From essen@REDACTED Sun Jul 22 14:32:29 2018 From: essen@REDACTED (=?UTF-8?Q?Lo=c3=afc_Hoguin?=) Date: Sun, 22 Jul 2018 14:32:29 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: Message-ID: Neither. The problem with this and the list comprehension equivalent [io:format("Message: ~s~n", [Msg]) || Msg /= undefined] is that it will confuse people who never encountered it before. But if one or both of these forms were teached to beginners and everyone was using them, then there'd be no problem in using them anymore. I'd love if they became more popular. Cheers, On 07/22/2018 02:25 PM, Viktor S?derqvist wrote: > Hey everyone, > > I've seen these short-circuit operators with a non-boolean second > operand, usually where the second operand is doing some side-effect and > the return value is not important. It seems to be a trend. Example: > > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), > > I this good or bad style? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Lo?c Hoguin https://ninenines.eu From rtrlists@REDACTED Sun Jul 22 15:23:57 2018 From: rtrlists@REDACTED (Robert Raschke) Date: Sun, 22 Jul 2018 15:23:57 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: Message-ID: I think this kind of style originated in languages like Perl, Lua and Javascript for writing shorthand code for default values. Things like "v = v or -1". >From there things spread, leading to odd combinations, like the examples you quote with side effects. In the end it is about readability, sometimes the shortcut can read nicer than a case or if statement. And sometimes it is clearer to be a teensy bit more verbose. Robby On 22 Jul 2018 14:25, "Viktor S?derqvist" wrote: > Hey everyone, > > I've seen these short-circuit operators with a non-boolean second > operand, usually where the second operand is doing some side-effect and > the return value is not important. It seems to be a trend. Example: > > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), > > I this good or bad style? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From freza@REDACTED Sun Jul 22 21:10:34 2018 From: freza@REDACTED (Jachym Holecek) Date: Sun, 22 Jul 2018 15:10:34 -0400 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: Message-ID: <20180722191034.GA20319@circlewave.net> Hi, # Viktor S?derqvist 2018-07-22: > Hey everyone, > > I've seen these short-circuit operators with a non-boolean second > operand, usually where the second operand is doing some side-effect and > the return value is not important. It seems to be a trend. Example: > > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), > > I this good or bad style? It is horrible style. Pain to read, pain to modify, pain to reason about. Simple clear question deserves a simple clear answer. :-) BR, -- Jachym From jesper.louis.andersen@REDACTED Mon Jul 23 13:05:37 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 23 Jul 2018 13:05:37 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: <20180722191034.GA20319@circlewave.net> References: <20180722191034.GA20319@circlewave.net> Message-ID: On Sun, Jul 22, 2018 at 9:09 PM Jachym Holecek wrote: > # Viktor S?derqvist 2018-07-22: > > > > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), > > > > I this good or bad style? > > It is horrible style. Pain to read, pain to modify, pain to reason about. > > Simple clear question deserves a simple clear answer. :-) > > ?I don't like the style either, mostly because it messes with the types. andalso and orelse expects boolean expressions, but the style used breaks that format. However, something like [x || Msg /= undefined] doesn't.? -- J. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dmytro.lytovchenko@REDACTED Mon Jul 23 13:20:48 2018 From: dmytro.lytovchenko@REDACTED (Dmytro Lytovchenko) Date: Mon, 23 Jul 2018 13:20:48 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <20180722191034.GA20319@circlewave.net> Message-ID: Just checked that a function is not created when you compile [X || condition] and it creates a check and a branch instruction. Amazing. Thanks for the tip. 2018-07-23 13:05 GMT+02:00 Jesper Louis Andersen < jesper.louis.andersen@REDACTED>: > On Sun, Jul 22, 2018 at 9:09 PM Jachym Holecek > wrote: > >> # Viktor S?derqvist 2018-07-22: >> > >> > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), >> > >> > I this good or bad style? >> >> It is horrible style. Pain to read, pain to modify, pain to reason about. >> >> Simple clear question deserves a simple clear answer. :-) >> >> > ?I don't like the style either, mostly because it messes with the types. > andalso and orelse expects boolean expressions, but the style used breaks > that format. However, something like > > [x || Msg /= undefined] > > doesn't.? > > > -- > J. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From g9414002.pccu.edu.tw@REDACTED Mon Jul 23 13:25:55 2018 From: g9414002.pccu.edu.tw@REDACTED (=?UTF-8?B?6buD6ICA6LOiIChZYXUtSHNpZW4gSHVhbmcp?=) Date: Mon, 23 Jul 2018 19:25:55 +0800 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <20180722191034.GA20319@circlewave.net> Message-ID: IMO, it's meaningful. Think that, Msg /= nil and io:fwrite("blah, blah, ...~n"). %% It won't build a boolean expression. But Msg /= nil andalso io:fwrite("blah, blah, ...~n"). %% Confirm the Msg is nothing and also say "blah, blah, ..." I think the reason why andalso/2 was built. Though, andalso/2 won't be used for a general default value usage like what we saw in JS or Perl, because the first argument of andalso/2 must be either true or false. On Mon, Jul 23, 2018 at 7:05 PM, Jesper Louis Andersen < jesper.louis.andersen@REDACTED> wrote: > On Sun, Jul 22, 2018 at 9:09 PM Jachym Holecek > wrote: > >> # Viktor S?derqvist 2018-07-22: >> > >> > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), >> > >> > I this good or bad style? >> >> It is horrible style. Pain to read, pain to modify, pain to reason about. >> >> Simple clear question deserves a simple clear answer. :-) >> >> > ?I don't like the style either, mostly because it messes with the types. > andalso and orelse expects boolean expressions, but the style used breaks > that format. However, something like > > [x || Msg /= undefined] > > doesn't.? > > > -- > J. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > -- Best Regards. --- Y-H. H. -------------- next part -------------- An HTML attachment was scrubbed... URL: From be.dmitry@REDACTED Mon Jul 23 15:32:46 2018 From: be.dmitry@REDACTED (Dmitry Belyaev) Date: Mon, 23 Jul 2018 23:32:46 +1000 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <20180722191034.GA20319@circlewave.net> Message-ID: How does it mess with types? The andalso and orelse operators should only care about the type of the first operand and it always is boolean. I personally don't like list comprehension as brackets create additional noise and might not be obvious to other developers. Also dialyzer may complain about unused value in either of ways, so the cleanest is probably case or if. The latter in Elixir doesn't require else branch which reduces noise a little bit. On 23 July 2018 21:05:37 GMT+10:00, Jesper Louis Andersen wrote: >On Sun, Jul 22, 2018 at 9:09 PM Jachym Holecek >wrote: > >> # Viktor S?derqvist 2018-07-22: >> > >> > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), >> > >> > I this good or bad style? >> >> It is horrible style. Pain to read, pain to modify, pain to reason >about. >> >> Simple clear question deserves a simple clear answer. :-) >> >> >?I don't like the style either, mostly because it messes with the >types. >andalso and orelse expects boolean expressions, but the style used >breaks >that format. However, something like > >[x || Msg /= undefined] > >doesn't.? > > >-- >J. -- Kind regards, Dmitry Belyaev -------------- next part -------------- An HTML attachment was scrubbed... URL: From jesper.louis.andersen@REDACTED Mon Jul 23 15:53:08 2018 From: jesper.louis.andersen@REDACTED (Jesper Louis Andersen) Date: Mon, 23 Jul 2018 15:53:08 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <20180722191034.GA20319@circlewave.net> Message-ID: On Mon, Jul 23, 2018 at 3:32 PM Dmitry Belyaev wrote: > How does it mess with types? The andalso and orelse operators should only > care about the type of the first operand and it always is boolean. > > ?Assume a GADT or dependently typed language. Then we have something like (forgive me the rust on the Agdaish notation used here): data Ty where Bool : Ty Int : Ty data Expr (t : Ty) : Set where andAlso : Expr Bool -> Expr Bool -> Expr Bool orElse : Expr Bool -> Expr Bool -> Expr Bool ... ?and this is the normal canonical definition most statically typed languages use. You propose data Expr (t : Ty) : Set where andAlso : Expr Bool -> Expr t -> Expr ? orElse : Expr Bool -> Expr t -> Expr ? ... but the complication is that you have to be able to tell the system what the '?' should be. It is some union type over either Bool or t for any type t, but this easily complicates the type rules of the language. This is why I say it is a "mess". You might come up with a solution, but that solution will usually lead to an acceptance of a larger body of programs in which some of the programs will be weaker from a type perspective. Or it will lead to programs which has to do more runtime checking which are slower programs. Finally, in a dynamically typed language like Erlang, you indeed can give it a somewhat meaningful result by your proposal. But my view, as it often does, comes from 15 years of statically typed programming in Standard ML, OCaml and Haskell. -------------- next part -------------- An HTML attachment was scrubbed... URL: From greim@REDACTED Mon Jul 23 16:01:13 2018 From: greim@REDACTED (greim) Date: Mon, 23 Jul 2018 16:01:13 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <20180722191034.GA20319@circlewave.net> Message-ID: "Programs must not regarded as code for computers, but as literature for humans" Nicklaus Wirth, Turing Award 1984 ....... so whats your opinion about: Msg /= undefined maybeornot io:format("Message: ~s~n", [Msg]), or much more readable and clear with a well defined operator, because we have a functional language: Msg /= undefined F@*#! io:format("Message: ~s~n", [Msg]), Markus Greim Am 23.07.2018 um 15:32 schrieb Dmitry Belyaev: > How does it mess with types? The andalso and orelse operators should > only care about the type of the first operand and it always is boolean. > > I personally don't like list comprehension as brackets create additional > noise and might not be obvious to other developers. > > Also dialyzer may complain about unused value in either of ways, so the > cleanest is probably case or if. The latter in Elixir doesn't require > else branch which reduces noise a little bit. > > On 23 July 2018 21:05:37 GMT+10:00, Jesper Louis Andersen > wrote: > > On Sun, Jul 22, 2018 at 9:09 PM Jachym Holecek > wrote: > > # Viktor S?derqvist 2018-07-22: > > > >? ? ?Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), > > > > I this good or bad style? > > It is horrible style. Pain to read, pain to modify, pain to > reason about. > > Simple clear question deserves a simple clear answer. :-) > > > ?I don't like the style either, mostly because it messes with the > types. andalso and orelse expects boolean expressions, but the style > used breaks that format. However, something like > > [x || Msg /= undefined] > > doesn't.? > > > -- > Kind regards, > Dmitry Belyaev > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From dmkolesnikov@REDACTED Mon Jul 23 16:16:56 2018 From: dmkolesnikov@REDACTED (Dmitry Kolesnikov) Date: Mon, 23 Jul 2018 17:16:56 +0300 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <20180722191034.GA20319@circlewave.net> Message-ID: This is a clear case for Option data type? I would prefer to use explicit definition of a function that is able to handle undefined values ``` print(undefined) -> undefined; print(Msg) -> io:format("Message: ~s~n", [Msg]). ``` Alternatively, there is a parse transforms for composition of maybe/option types (https://github.com/fogfish/datum/blob/master/doc/category.md#option ) Long time ago, I?ve used andalso syntax but it never stays longer at code repository due to readability. It has been refactored to function(s) with guards or pattern match. Best Regards, Dmitry > On 23 Jul 2018, at 16.32, Dmitry Belyaev wrote: > > How does it mess with types? The andalso and orelse operators should only care about the type of the first operand and it always is boolean. > > I personally don't like list comprehension as brackets create additional noise and might not be obvious to other developers. > > Also dialyzer may complain about unused value in either of ways, so the cleanest is probably case or if. The latter in Elixir doesn't require else branch which reduces noise a little bit. > > On 23 July 2018 21:05:37 GMT+10:00, Jesper Louis Andersen wrote: > On Sun, Jul 22, 2018 at 9:09 PM Jachym Holecek > wrote: > # Viktor S?derqvist 2018-07-22: > > > > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), > > > > I this good or bad style? > > It is horrible style. Pain to read, pain to modify, pain to reason about. > > Simple clear question deserves a simple clear answer. :-) > > > ?I don't like the style either, mostly because it messes with the types. andalso and orelse expects boolean expressions, but the style used breaks that format. However, something like > > [x || Msg /= undefined] > > doesn't.? > > > -- > Kind regards, > Dmitry Belyaev > _______________________________________________ > 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: 833 bytes Desc: Message signed with OpenPGP URL: From z@REDACTED Mon Jul 23 17:32:23 2018 From: z@REDACTED (Danil Zagoskin) Date: Mon, 23 Jul 2018 18:32:23 +0300 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: Message-ID: Hi! I find this style convenient for debugging. Sometimes you need some binding to be logged, but only under some rare conditions. After the problem is fixed the added code should be removed or commented-out. Adding a simple if (or case) costs you 4 lines and an extra tabulation. Removing/disabling that requires selecting several lines, then deleting/commenting them. Adding a wrapper function invades the code in two places. Removing that requires extra seeking to the helper function. Disabling (commenting the call) requires disabling the function too, to avoid unused function warning. Much pain. A single-liner with andalso/orelse is easy to write (shorter than other options) and easy to remove/disable (just jump to line + single dd or I in vim). On Sun, Jul 22, 2018 at 3:25 PM Viktor S?derqvist wrote: > Hey everyone, > > I've seen these short-circuit operators with a non-boolean second > operand, usually where the second operand is doing some side-effect and > the return value is not important. It seems to be a trend. Example: > > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), > > I this good or bad style? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Danil Zagoskin | z@REDACTED -------------- next part -------------- An HTML attachment was scrubbed... URL: From g9414002.pccu.edu.tw@REDACTED Mon Jul 23 17:48:08 2018 From: g9414002.pccu.edu.tw@REDACTED (=?UTF-8?B?6buD6ICA6LOiIChZYXUtSHNpZW4gSHVhbmcp?=) Date: Mon, 23 Jul 2018 23:48:08 +0800 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <20180722191034.GA20319@circlewave.net> Message-ID: Though the RHS of andalso is not typed in Erlang. On Mon, Jul 23, 2018 at 10:35 PM, Richard O'Keefe wrote: > No, that is *not* why andalso/2 was added to the language. > The very spelling of the token, 'andalso', was copied from > a language, Standard ML, which is strictly typed and does > not allow andalso . > > On 23 July 2018 at 23:25, ??? (Yau-Hsien Huang) < > g9414002.pccu.edu.tw@REDACTED> wrote: > >> IMO, it's meaningful. >> >> Think that, >> >> Msg /= nil and io:fwrite("blah, blah, ...~n"). %% It won't build a >> boolean expression. >> >> But >> >> Msg /= nil andalso io:fwrite("blah, blah, ...~n"). %% Confirm the Msg is >> nothing and also say "blah, blah, ..." >> >> I think the reason why andalso/2 was built. Though, andalso/2 won't be >> used for a general default value usage like what we saw in JS or Perl, >> because the first argument of andalso/2 must be either true or false. >> >> >> >> On Mon, Jul 23, 2018 at 7:05 PM, Jesper Louis Andersen < >> jesper.louis.andersen@REDACTED> wrote: >> >>> On Sun, Jul 22, 2018 at 9:09 PM Jachym Holecek >>> wrote: >>> >>>> # Viktor S?derqvist 2018-07-22: >>>> > >>>> > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), >>>> > >>>> > I this good or bad style? >>>> >>>> It is horrible style. Pain to read, pain to modify, pain to reason >>>> about. >>>> >>>> Simple clear question deserves a simple clear answer. :-) >>>> >>>> >>> ?I don't like the style either, mostly because it messes with the types. >>> andalso and orelse expects boolean expressions, but the style used breaks >>> that format. However, something like >>> >>> [x || Msg /= undefined] >>> >>> doesn't.? >>> >>> >>> -- >>> J. >>> >>> _______________________________________________ >>> erlang-questions mailing list >>> erlang-questions@REDACTED >>> http://erlang.org/mailman/listinfo/erlang-questions >>> >>> >> >> >> -- >> >> Best Regards. >> >> --- Y-H. H. >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- Best Regards. --- Y-H. H. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan@REDACTED Mon Jul 23 16:28:32 2018 From: ivan@REDACTED (Ivan Uemlianin) Date: Mon, 23 Jul 2018 15:28:32 +0100 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <20180722191034.GA20319@circlewave.net> Message-ID: Yes, same here.? Anything clever but unreadable I would put in an informatively-named function.? I might call this print_unless_undefined/1. Ivan On 23/07/2018 15:16, Dmitry Kolesnikov wrote: > This is a clear case for Option data type? > > I would prefer to use explicit definition of a function that is able > to handle undefined values > > ``` > print(undefined) -> > ? ?undefined; > print(Msg) -> > ? ?io:format("Message: ~s~n", [Msg]). > ``` > > Alternatively, there is a parse transforms for composition of > maybe/option types > (https://github.com/fogfish/datum/blob/master/doc/category.md#option) > > Long time ago, I?ve used andalso syntax but it never stays longer at > code repository due to readability. It has been refactored to > function(s) with guards or pattern match. > > Best Regards, > Dmitry > > >> On 23 Jul 2018, at 16.32, Dmitry Belyaev > > wrote: >> >> How does it mess with types? The andalso and orelse operators should >> only care about the type of the first operand and it always is boolean. >> >> I personally don't like list comprehension as brackets create >> additional noise and might not be obvious to other developers. >> >> Also dialyzer may complain about unused value in either of ways, so >> the cleanest is probably case or if. The latter in Elixir doesn't >> require else branch which reduces noise a little bit. >> >> On 23 July 2018 21:05:37 GMT+10:00, Jesper Louis Andersen >> > > wrote: >> >> On Sun, Jul 22, 2018 at 9:09 PM Jachym Holecek >> > wrote: >> >> # Viktor S?derqvist 2018-07-22: >> > >> >? ? ?Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), >> > >> > I this good or bad style? >> >> It is horrible style. Pain to read, pain to modify, pain to >> reason about. >> >> Simple clear question deserves a simple clear answer. :-) >> >> >> ?I don't like the style either, mostly because it messes with the >> types. andalso and orelse expects boolean expressions, but the >> style used breaks that format. However, something like >> >> [x || Msg /= undefined] >> >> doesn't.? >> >> >> -- >> Kind regards, >> Dmitry Belyaev >> _______________________________________________ >> 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 -- ============================================================ Ivan A. Uemlianin PhD Llaisdy Ymchwil a Datblygu Technoleg Lleferydd Speech Technology Research and Development ivan@REDACTED @llaisdy llaisdy.wordpress.com github.com/llaisdy www.linkedin.com/in/ivanuemlianin festina lente ============================================================ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ev@REDACTED Mon Jul 23 19:00:42 2018 From: ev@REDACTED (Evadne Wu) Date: Mon, 23 Jul 2018 18:00:42 +0100 Subject: [erlang-questions] Running a fleet of OS processes In-Reply-To: References: Message-ID: <85962CA3-86DC-40D3-B7BF-6246EDF398C8@radi.ws> It sounds a lot like mod_cgi so it depends on how much of Erlang/OTP you really need Also depending on how long the process takes to start, you can start with a pool of one-shot processes and replace them with new ones as you go. I have seen certain cases where a long-running but unused OS process actually decays into a bad state. IMO the child should report its state instead of the parent having to poll. As to limiting resource use, I think you can use cgroups. It allows you to set usage limits for Memory, Disk, etc. Once you have that sorted you can then start to limit the number of child OS processes and you can over-provision if necessary. Regards Evadne > On 9 Jul 2018, at 15:33, Yevhenii Kurtov wrote: > > Hi, > > I'm in a situation where most straightforward way to solve the task would be to run a 3rd party binary per each active user. > Each of those binaries speaks to the outside world and maintains their own state which is of great importance for the system. Without them user is basically blocked locked. > > The scope of the task is to: > - start 3rd party program for all users during application launch > - start 3rd party program on the go for new users > - continiously poll their state (JSON RPC API) and report updated state if it changed since last poll > - restart individual apps when they crash > > Idea is to start as many apps as node can carry on and I'm not sure what is the best way to tame this beast. > > I'm surely will use Erlexec and probably will create a gen_server that will keep a list of the processes in its state. > Then there will be a pool of workers that will go and poll a fleet once in a while. > > That's kinda basic scenario that I can think of, but maybe there are people who had similar problems and can suggest a better approach or advice on how to avoid bottlenecks. > > Apart from solving the architecture there is a resource monitoring problem to not overload the node. The memory utilization is not an issue, but I/O is. I wonder what would a right marker to stop spawning new processes? Logically I should somehow measure I/O utilization during poll and act accordingly. > With large enough pool of processes poll should be going all the time :) > > That's basically it. Any input is appreciated. > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From g9414002.pccu.edu.tw@REDACTED Mon Jul 23 19:41:15 2018 From: g9414002.pccu.edu.tw@REDACTED (=?UTF-8?B?6buD6ICA6LOiIChZYXUtSHNpZW4gSHVhbmcp?=) Date: Tue, 24 Jul 2018 01:41:15 +0800 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <20180722191034.GA20319@circlewave.net> Message-ID: I'm not interested in so-called "it's for something but the other." By typing some code in both shell, I got an error message in SML/NJ when typing the following code, > true andalso nil; though I got similar code working smoothly in Erlang when typing the following code, > is_list(true andalso []). %% The shell reported `true`. So, what's the meaning of "being copied into?" Is it rigid that you borrow a word from a language and keep all the nature of it? I don't think so. On Tue, Jul 24, 2018 at 12:58 AM, Richard O'Keefe wrote: > Yes, I know the RHS of 'andalso' is not typed in Erlang. > So what? The point is that when 'andalso' and 'orelse' > were copied into Erlang from Standard ML, they did not > drag the obsolete baggage of being ersatzes for WHEN and > UNLESS in with them. They were added to provide > non-strict AND and OR for Boolean expressions, and that > is all they were added for, just as 'and' and 'or' were > added to provide strict AND and OR. > > They were not added to provide a cryptic way to obfuscate > conditionals you could already easily write. > > > > On 24 July 2018 at 03:48, ??? (Yau-Hsien Huang) < > g9414002.pccu.edu.tw@REDACTED> wrote: > >> Though the RHS of andalso is not typed in Erlang. >> >> On Mon, Jul 23, 2018 at 10:35 PM, Richard O'Keefe >> wrote: >> >>> No, that is *not* why andalso/2 was added to the language. >>> The very spelling of the token, 'andalso', was copied from >>> a language, Standard ML, which is strictly typed and does >>> not allow andalso . >>> >>> On 23 July 2018 at 23:25, ??? (Yau-Hsien Huang) < >>> g9414002.pccu.edu.tw@REDACTED> wrote: >>> >>>> IMO, it's meaningful. >>>> >>>> Think that, >>>> >>>> Msg /= nil and io:fwrite("blah, blah, ...~n"). %% It won't build a >>>> boolean expression. >>>> >>>> But >>>> >>>> Msg /= nil andalso io:fwrite("blah, blah, ...~n"). %% Confirm the Msg >>>> is nothing and also say "blah, blah, ..." >>>> >>>> I think the reason why andalso/2 was built. Though, andalso/2 won't be >>>> used for a general default value usage like what we saw in JS or Perl, >>>> because the first argument of andalso/2 must be either true or false. >>>> >>>> >>>> >>>> On Mon, Jul 23, 2018 at 7:05 PM, Jesper Louis Andersen < >>>> jesper.louis.andersen@REDACTED> wrote: >>>> >>>>> On Sun, Jul 22, 2018 at 9:09 PM Jachym Holecek >>>>> wrote: >>>>> >>>>>> # Viktor S?derqvist 2018-07-22: >>>>>> > >>>>>> > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), >>>>>> > >>>>>> > I this good or bad style? >>>>>> >>>>>> It is horrible style. Pain to read, pain to modify, pain to reason >>>>>> about. >>>>>> >>>>>> Simple clear question deserves a simple clear answer. :-) >>>>>> >>>>>> >>>>> ?I don't like the style either, mostly because it messes with the >>>>> types. andalso and orelse expects boolean expressions, but the style used >>>>> breaks that format. However, something like >>>>> >>>>> [x || Msg /= undefined] >>>>> >>>>> doesn't.? >>>>> >>>>> >>>>> -- >>>>> J. >>>>> >>>>> _______________________________________________ >>>>> erlang-questions mailing list >>>>> erlang-questions@REDACTED >>>>> http://erlang.org/mailman/listinfo/erlang-questions >>>>> >>>>> >>>> >>>> >>>> -- >>>> >>>> Best Regards. >>>> >>>> --- Y-H. H. >>>> >>>> >>>> _______________________________________________ >>>> erlang-questions mailing list >>>> erlang-questions@REDACTED >>>> http://erlang.org/mailman/listinfo/erlang-questions >>>> >>>> >>> >> >> >> -- >> >> Best Regards. >> >> --- Y-H. H. >> >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> >> > -- Best Regards. --- Y-H. H. -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Tue Jul 24 05:41:48 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Tue, 24 Jul 2018 12:41:48 +0900 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: Message-ID: <2768873.NH1MvFoY5h@takoyaki> On 2018?7?22???? 14?25?00? JST Viktor S?derqvist wrote: > Hey everyone, > > I've seen these short-circuit operators with a non-boolean second > operand, usually where the second operand is doing some side-effect and > the return value is not important. It seems to be a trend. Example: > > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), > > I this good or bad style? That code should die in a fire and the author should say repent with the chanting of 100 Hail McCarthys. -Craig From john@REDACTED Tue Jul 24 09:13:22 2018 From: john@REDACTED (John =?ISO-8859-1?Q?H=F6gberg?=) Date: Tue, 24 Jul 2018 09:13:22 +0200 Subject: [erlang-questions] Patch package OTP 20.3.8.3 released Message-ID: <1532416402.4067.21.camel@erlang.org> Patch Package:???????????OTP 20.3.8.3 Git Tag:?????????????????OTP-20.3.8.3 Date:????????????????????2018-07-24 Trouble Report Id:???????OTP-15158, OTP-15170, OTP-15178, OTP-15179, ?????????????????????????OTP-15181, OTP-15192, OTP-15193 Seq num:?????????????????ERIERL-208, ERL-654 System:??????????????????OTP Release:?????????????????20 Application:?????????????erts-9.3.3.2, ic-4.4.4.2, inets-6.5.2.2, ?????????????????????????kernel-5.4.3.2, ssl-8.2.6.1 Predecessor:?????????????OTP 20.3.8.2 ?Check out the git tag OTP-20.3.8.3, 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-9.3.3.2 ---------------------------------------------------- ?--------------------------------------------------------------------- ?The erts-9.3.3.2 application can be applied independently of other ?applications on a full OTP 20 installation. ?--- Fixed Bugs and Malfunctions --- ? OTP-15158????Application(s): erts ???????????????Related Id(s): ERL-654 ???????????????Fixed a race condition in the inet driver that could ???????????????cause receive to hang when the emulator was compiled ???????????????with gcc 8. ? OTP-15181????Application(s): erts ???????????????Fix bug in generation of erl_crash.dump, which could ???????????????cause VM to crash. ???????????????Bug exist since erts-9.2 (OTP-20.2). ?Full runtime dependencies of erts-9.3.3.2: kernel-5.0, sasl-3.0.1, ?stdlib-3.0 ?--------------------------------------------------------------------- ?--- ic-4.4.4.2 ------------------------------------------------------ ?--------------------------------------------------------------------- ?The ic-4.4.4.2 application can be applied independently of other ?applications on a full OTP 20 installation. ?--- Fixed Bugs and Malfunctions --- ? OTP-15179????Application(s): ic ???????????????Related Id(s): ERIERL-208 ???????????????Fixed potential buffer overflow bugs in ???????????????oe_ei_encode_long/ulong/longlong/ulonglong functions on ???????????????64-bit architectures. These functions expect 32 bit ???????????????integers as the IDL type "long" is defined as 32 bits. ???????????????But there is nothing preventing user code from ???????????????"breaking" the interface and pass larger values on ???????????????64-bit architectures where the C type "long" is 64 ???????????????bits. ?Full runtime dependencies of ic-4.4.4.2: erts-6.0, kernel-3.0, ?stdlib-2.0 ?--------------------------------------------------------------------- ?--- inets-6.5.2.2 --------------------------------------------------- ?--------------------------------------------------------------------- ?The inets-6.5.2.2 application can be applied independently of other ?applications on a full OTP 20 installation. ?--- Fixed Bugs and Malfunctions --- ? OTP-15192????Application(s): inets ???????????????Enhance error handling, that is mod_get will return 403 ???????????????if a path is a directory and not a file. ?Full runtime dependencies of inets-6.5.2.2: erts-6.0, kernel-3.0, ?mnesia-4.12, runtime_tools-1.8.14, ssl-5.3.4, stdlib-2.0 ?--------------------------------------------------------------------- ?--- kernel-5.4.3.2 -------------------------------------------------- ?--------------------------------------------------------------------- ?Note! The kernel-5.4.3.2 application can *not* be applied ???????independently of other applications on an arbitrary OTP 20 ???????installation. ???????On a full OTP 20 installation, also the following runtime ???????dependency has to be satisfied: ???????-- erts-9.3 (first satisfied in OTP 20.3) ?--- Fixed Bugs and Malfunctions --- ? OTP-15170????Application(s): kernel ???????????????Non semantic change in dist_util.erl to silence ???????????????dialyzer warning. ?Full runtime dependencies of kernel-5.4.3.2: erts-9.3, sasl-3.0, ?stdlib-3.4 ?--------------------------------------------------------------------- ?--- ssl-8.2.6.1 ----------------------------------------------------- ?--------------------------------------------------------------------- ?Note! The ssl-8.2.6.1 application can *not* be applied independently ???????of other applications on an arbitrary OTP 20 installation. ???????On a full OTP 20 installation, also the following runtime ???????dependencies have to be satisfied: ???????-- crypto-4.2 (first satisfied in OTP 20.2) ???????-- public_key-1.5 (first satisfied in OTP 20.1) ?--- Fixed Bugs and Malfunctions --- ? OTP-15178????Application(s): ssl ???????????????Improve cipher suite handling correcting ECC and ???????????????TLS-1.2 requierments. Backport of solution for ERL-641 ?--- Improvements and New Features --- ? OTP-15193????Application(s): ssl ???????????????Option keyfile defaults to certfile and should be ???????????????trumped with key. This failed for engine keys. ?Full runtime dependencies of ssl-8.2.6.1: crypto-4.2, erts-7.0, ?inets-5.10.7, kernel-3.0, public_key-1.5, stdlib-3.2 ?--------------------------------------------------------------------- ?--------------------------------------------------------------------- ?--------------------------------------------------------------------- From pierrefenoll@REDACTED Tue Jul 24 09:19:56 2018 From: pierrefenoll@REDACTED (Pierre Fenoll) Date: Tue, 24 Jul 2018 09:19:56 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: <2768873.NH1MvFoY5h@takoyaki> References: <2768873.NH1MvFoY5h@takoyaki> Message-ID: I don?t understand the strong answers. To me the semantics of orelse/and also are well known. They are even known as ||/&& in the mainstream. They have their use as the common boolean shortcut operators. They are even more than that: case ShouldOpen andalso file:open(...) of false -> {error,_} -> {ok,_} -> end These operators are very interesting semantics. Erlang is not exactly a pure language. Being able to express side effects in such an easy-to-comment amount of code that?s just priceless. Here?s a legit example: https://github.com/2600hz/kazoo/blob/master/applications/tasks/src/kz_tasks_scheduler.erl#L526 So why the big words? What?s next, the process dictionary, using list comprehensions with 1-element lists generators? To me if you don?t like this kind of code it?s only because you have not needed / seen it much. So, read more code? On Tue 24 Jul 2018 at 05:42, wrote: > On 2018?7?22???? 14?25?00? JST Viktor S?derqvist wrote: > > Hey everyone, > > > > I've seen these short-circuit operators with a non-boolean second > > operand, usually where the second operand is doing some side-effect and > > the return value is not important. It seems to be a trend. Example: > > > > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), > > > > I this good or bad style? > > That code should die in a fire and the author should say repent with > the chanting of 100 Hail McCarthys. > > -Craig > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -- Cheers, -- Pierre Fenoll -------------- next part -------------- An HTML attachment was scrubbed... URL: From greim@REDACTED Tue Jul 24 09:38:08 2018 From: greim@REDACTED (greim) Date: Tue, 24 Jul 2018 09:38:08 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <20180722191034.GA20319@circlewave.net> Message-ID: Am 23.07.2018 um 16:28 schrieb Ivan Uemlianin: > Yes, same here.? Anything clever but unreadable I would put in an > informatively-named function.? I might call this print_unless_undefined/1. > yep, now we are going in the right direction, that is self explaining! Markus > Ivan > > > On 23/07/2018 15:16, Dmitry Kolesnikov wrote: >> This is a clear case for Option data type? >> >> I would prefer to use explicit definition of a function that is able >> to handle undefined values >> >> ``` >> print(undefined) -> >> ? ?undefined; >> print(Msg) -> >> ? ?io:format("Message: ~s~n", [Msg]). >> ``` >> >> Alternatively, there is a parse transforms for composition of >> maybe/option types >> (https://github.com/fogfish/datum/blob/master/doc/category.md#option) >> >> Long time ago, I?ve used andalso syntax but it never stays longer at >> code repository due to readability. It has been refactored to >> function(s) with guards or pattern match. >> >> Best Regards, >> Dmitry >> >> >>> On 23 Jul 2018, at 16.32, Dmitry Belyaev >> > wrote: >>> >>> How does it mess with types? The andalso and orelse operators should >>> only care about the type of the first operand and it always is boolean. >>> >>> I personally don't like list comprehension as brackets create >>> additional noise and might not be obvious to other developers. >>> >>> Also dialyzer may complain about unused value in either of ways, so >>> the cleanest is probably case or if. The latter in Elixir doesn't >>> require else branch which reduces noise a little bit. >>> >>> On 23 July 2018 21:05:37 GMT+10:00, Jesper Louis Andersen >>> >> > wrote: >>> >>> On Sun, Jul 22, 2018 at 9:09 PM Jachym Holecek >>> > wrote: >>> >>> # Viktor S?derqvist 2018-07-22: >>> > >>> >? ? ?Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), >>> > >>> > I this good or bad style? >>> >>> It is horrible style. Pain to read, pain to modify, pain to >>> reason about. >>> >>> Simple clear question deserves a simple clear answer. :-) >>> >>> >>> ?I don't like the style either, mostly because it messes with the >>> types. andalso and orelse expects boolean expressions, but the >>> style used breaks that format. However, something like >>> >>> [x || Msg /= undefined] >>> >>> doesn't.? >>> >>> >>> -- >>> Kind regards, >>> Dmitry Belyaev >>> _______________________________________________ >>> 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 > > -- > ============================================================ > Ivan A. Uemlianin PhD > Llaisdy > > Ymchwil a Datblygu Technoleg Lleferydd > Speech Technology Research and Development > > ivan@REDACTED > @llaisdy > llaisdy.wordpress.com > github.com/llaisdy > www.linkedin.com/in/ivanuemlianin > > festina lente > ============================================================ > > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From zxq9@REDACTED Tue Jul 24 10:00:56 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Tue, 24 Jul 2018 17:00:56 +0900 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <2768873.NH1MvFoY5h@takoyaki> Message-ID: <1778490.XGnqCR9X2H@takoyaki> On 2018?7?24???? 9?19?56? JST Pierre Fenoll wrote: > I don?t understand the strong answers. > To me the semantics of orelse/and also are well known. "To me... well known" Says it all. -Craig From nathaniel@REDACTED Tue Jul 24 14:06:59 2018 From: nathaniel@REDACTED (Nathaniel Waisbrot) Date: Tue, 24 Jul 2018 08:06:59 -0400 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: <1778490.XGnqCR9X2H@takoyaki> References: <2768873.NH1MvFoY5h@takoyaki> <1778490.XGnqCR9X2H@takoyaki> Message-ID: > On Jul 24, 2018, at 4:00 AM, zxq9@REDACTED wrote: > >> On 2018?7?24???? 9?19?56? JST Pierre Fenoll wrote: >> I don?t understand the strong answers. >> To me the semantics of orelse/and also are well known. > > "To me... well known" > > Says it all. Well, it?s a pattern I?ve seen in both lisp and javascript, so I agree that it?s not a totally wild idea. A pretty wide swath of programmers should be able to recognize what?s happening. I feel like avoiding the pattern is more on the language than the programmer, too. You don?t see this pattern in languages without side-effects and you don?t get it when both sides of && must be booleans. OTOH if the language hands me a tool and I see a convenient use for it, why should I hold back? From ledest@REDACTED Tue Jul 24 09:38:21 2018 From: ledest@REDACTED (Led) Date: Tue, 24 Jul 2018 10:38:21 +0300 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <2768873.NH1MvFoY5h@takoyaki> Message-ID: 2018-07-24 10:19 GMT+03:00 Pierre Fenoll : > I don?t understand the strong answers. > > Do not pay attention to ruby-influensed people :) -- Led. -------------- next part -------------- An HTML attachment was scrubbed... URL: From empro2@REDACTED Tue Jul 24 11:02:43 2018 From: empro2@REDACTED (empro2@REDACTED) Date: Tue, 24 Jul 2018 11:02:43 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' Message-ID: <20180724110243.11f236ce@raspy> This is only the most recent occurrence that finally makes me write this: [erlang-questions] Patch package OTP 20.3.8.3 released Tue, 24 Jul 2018 09:13:22 +0200 [...] Note! The kernel-5.4.3.2 application can *not* be applied ??????independently of other applications on an arbitrary OTP 20 installation. [...] If it can not be applied independently then it can also be applied independently - which, in this case, is probably not what is meant. But this is guesswork, relying on the reader already knowing the meaning of what is being said, rendering the saying it much less useful. Modals are a mess (spoken languages are, after ceturies of abuse like the one discussed in "[erlang-questions] Orelse and andalso as short-hand for case"), but they convey critical meaning. Nine(?) of ten "can not"s in the Erlang docs must be "cannot" to convey the correct meaning. Reading the docs has already made me convert every "can not" I read into "cannot" - I mean *every*, not only those in the Erlang docs - and then back again (only about 1 of 10 in the Erlang docs). This is a real, and substantial, waste of post-orbital CPU cycles; not the conversion itself, but the distraction from understanding whatever meaning the author actually tries to get across. If someone with authority (and authorisation) could and would please write and run a script and convert all "can not" -> "cannot" in all OTP strings, binaries and comments? This will introduce errors, as there actually are a few, rare correct "can not"s, but it will correct about 9 times more of wrong ones that really need to be "cannot". At least in the doc strings? Please? Michael -- Time is not money, but money is time: life-time people have spent transforming their environment. From empro2@REDACTED Tue Jul 24 12:26:57 2018 From: empro2@REDACTED (empro2@REDACTED) Date: Tue, 24 Jul 2018 12:26:57 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <2768873.NH1MvFoY5h@takoyaki> Message-ID: <20180724122657.376285a4@raspy> Am Tue, 24 Jul 2018 09:19:56 +0200 schrieb Pierre Fenoll : > I don?t understand the strong answers. Then let me try to help :-) > To me the semantics of orelse/and also are well known. Are they? Or do you merely know of a different way to (ab)use them? > They are even known as ||/&& in the mainstream. The "mainstream"? or C and bash and whatever? What about Perl's: succeed() or die("fast")? > They have their use as the common boolean shortcut > operators. Languages have their (ab)use by marketing persons and spokespeople and lawyers; but does that make a better - easier to learn, expressive, concise - language? a better world for everyone (or most, actually)? > These operators are very interesting semantics. See? Now I have to guess whether this is merely a (completely acceptable) mistake or something I do not (yet) understand. Operators are no semantics, but ... It may as well be that you confuse semantics with syntax, because you say "easy-to-comment" below, so it might be the syntax that appeals to you (and others, this all is not meant to be personal :-). > not exactly a pure language. Off topic, this is about whether one codes for the compiler or the programmer. No compiler has ever lamented about the Obfuscated C Code Contest, full of things one _can_ write ... "Pure"? like 'completely and only functional'? All programs will eventually push something to an output device, which is inherently non-functional (or is it?) > Being able to express side > effects in such an easy-to-comment amount of code that?s > just priceless. Concise is fine, simply and only and first of all 'few lines' is not price- but ruthless. > Here?s a legit example: > https://github.com/2600hz/kazoo/blob/master/applications/tasks/src/kz_tasks_scheduler.erl#L526 Is it legit? why? Why not: if Pid =:= WorkerPid -> throw({'task', Task}) end, ? Not even now I am sure that this translation is correct, and that after the much too long time that code forced me to spend on understanding it. I am sure the compiler does not complain ... > So why the big words? What?s next, the process > dictionary, using list comprehensions with 1-element > lists generators? In what better way would you express the process dict? Or why not spawn a function and stuff all state into its dictionary, have set/2 and get/1 to mutate and read the attributes and call it OOerlang ... or WoeWoeErlang ... If you want to translate/map or reduce/filter a list A to produce a list B, it does not matter whether A happens to have only one element or none (apart from []) or several or many; that is what lists and list comprehension are meant for. If one does not want to process a list, and does not even want but create one - [x || Msg /= undefined] - then ... perhaps the author should die in a fire ;-) Note: it does not matter what the compiler (writer) makes of this. > To me if you don?t like this kind of > code it?s only because you have not needed / seen it > much. So, read more code? So if people have trouble walking on their hands they need more practice? Michael P. S. All "you"s and "I"s are to be read as 'one'. This really is not meant to be personal. -- That, which was said, is not that, which was spoken, but that, which was understood; and none of these comes necessarily close to that, which was meant. From hugo@REDACTED Tue Jul 24 15:16:22 2018 From: hugo@REDACTED (Hugo Mills) Date: Tue, 24 Jul 2018 13:16:22 +0000 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180724110243.11f236ce@raspy> References: <20180724110243.11f236ce@raspy> Message-ID: <20180724131622.GF21293@carfax.org.uk> On Tue, Jul 24, 2018 at 11:02:43AM +0200, empro2@REDACTED wrote: > This is only the most recent occurrence that finally > makes me write this: > > > [erlang-questions] Patch package OTP 20.3.8.3 released > Tue, 24 Jul 2018 09:13:22 +0200 > [...] > Note! The kernel-5.4.3.2 application can *not* be applied > ??????independently of other applications on an arbitrary > OTP 20 installation. > [...] > > > If it can not be applied independently then it can also be > applied independently Eh? In no way is that the implication here. "can *not*", to me as a native speaker of the language, is the same as "cannot", with additional emphasis. I've been trying to identify other meanings using alternative readings or logical inference, but none of them come naturally, or would make any sense. You're asking for a change which makes no difference whatsoever. Hugo. > - which, in this case, is > probably not what is meant. But this is guesswork, relying > on the reader already knowing the meaning of what is > being said, rendering the saying it much less useful. > > Modals are a mess (spoken languages are, after ceturies of > abuse like the one discussed in "[erlang-questions] Orelse > and andalso as short-hand for case"), but they convey > critical meaning. > > Nine(?) of ten "can not"s in the Erlang docs must be > "cannot" to convey the correct meaning. Reading the docs has > already made me convert every "can not" I read into > "cannot" - I mean *every*, not only those in the Erlang > docs - and then back again (only about 1 of 10 in the > Erlang docs). This is a real, and substantial, waste of > post-orbital CPU cycles; not the conversion itself, but the > distraction from understanding whatever meaning the author > actually tries to get across. > > If someone with authority (and authorisation) could and > would please write and run a script and convert all "can > not" -> "cannot" in all OTP strings, binaries and comments? > This will introduce errors, as there actually are a few, > rare correct "can not"s, but it will correct about 9 times > more of wrong ones that really need to be "cannot". > > At least in the doc strings? > > Please? > > Michael > -- Hugo Mills | I used to be a mathematician, but I'm better now. 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 marc@REDACTED Tue Jul 24 15:17:10 2018 From: marc@REDACTED (Marc Worrell) Date: Tue, 24 Jul 2018 15:17:10 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180724110243.11f236ce@raspy> References: <20180724110243.11f236ce@raspy> Message-ID: Hi Michael, ?Cannot? and ?can not? are both acceptable spellings. And there is no difference in meaning. See also: https://www.dailywritingtips.com/cannot-or-can-not/ > If it can not be applied independently then it can also be > applied independently - which, in this case, is [..] Could it be that you see ?can not only? where it says ?can not? ? - Marc > On 24 Jul 2018, at 11:02, wrote: > > This is only the most recent occurrence that finally > makes me write this: > > > [erlang-questions] Patch package OTP 20.3.8.3 released > Tue, 24 Jul 2018 09:13:22 +0200 > [...] > Note! The kernel-5.4.3.2 application can *not* be applied > independently of other applications on an arbitrary > OTP 20 installation. > [...] > > > If it can not be applied independently then it can also be > applied independently - which, in this case, is > probably not what is meant. But this is guesswork, relying > on the reader already knowing the meaning of what is > being said, rendering the saying it much less useful. > > Modals are a mess (spoken languages are, after ceturies of > abuse like the one discussed in "[erlang-questions] Orelse > and andalso as short-hand for case"), but they convey > critical meaning. > > Nine(?) of ten "can not"s in the Erlang docs must be > "cannot" to convey the correct meaning. Reading the docs has > already made me convert every "can not" I read into > "cannot" - I mean *every*, not only those in the Erlang > docs - and then back again (only about 1 of 10 in the > Erlang docs). This is a real, and substantial, waste of > post-orbital CPU cycles; not the conversion itself, but the > distraction from understanding whatever meaning the author > actually tries to get across. > > If someone with authority (and authorisation) could and > would please write and run a script and convert all "can > not" -> "cannot" in all OTP strings, binaries and comments? > This will introduce errors, as there actually are a few, > rare correct "can not"s, but it will correct about 9 times > more of wrong ones that really need to be "cannot". > > At least in the doc strings? > > Please? > > Michael > > -- > > Time is not money, but money is time: life-time people have > spent transforming their environment. > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From be.dmitry@REDACTED Tue Jul 24 16:17:22 2018 From: be.dmitry@REDACTED (Dmitry Belyaev) Date: Wed, 25 Jul 2018 00:17:22 +1000 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: <20180724122657.376285a4@raspy> References: <2768873.NH1MvFoY5h@takoyaki> <20180724122657.376285a4@raspy> Message-ID: <2FD7F474-F6C8-44F3-BFAE-6783A1AEB162@gmail.com> On 24 July 2018 20:26:57 GMT+10:00, empro2@REDACTED wrote: >... >Why not: > > if Pid =:= WorkerPid -> throw({'task', Task}) end, > Because it doesn't work for the false case. In Erlang if and case are expressions and they have to be exhaustive and return values for each case. Otherwise they will throw errors. -- Kind regards, Dmitry Belyaev From lutz.behnke@REDACTED Tue Jul 24 16:33:37 2018 From: lutz.behnke@REDACTED (Lutz Behnke) Date: Tue, 24 Jul 2018 16:33:37 +0200 Subject: [erlang-questions] Retrieving the dependencies of a module Message-ID: <4b8cf1e5-a7a2-f8b4-621d-e00d41215de6@informatik.haw-hamburg.de> Hi there, I am trying to find out what other modules the functions in a given module are calling. Is there a standard mechanism to do so? I have the following problem: In one application build with rebar3: app_one/src/a.erl: -module(a) f1() -> b:f2(). in the other application, also build with rebar3: app_two/src/b.erl: -module(b) f2() -> c:f3(). The module c is nowhere defined in either application one, two, or the dependencies either pulls. When I run the tests of application two everything works, when I try to call the code from the module a, I get: {failed_to_start_child,b, {undef, [{c,f3,[],[]}, {b,f2,1,[{...}|...]}, {gen_server,init_it,2,[...]}, {gen_server,init_it,6,...}, {proc_lib,init_p_do_apply,...}]}}} application two is specifically my fork of plumtree: https://github.com/timadorus/plumtree Therefore I am trying to understand what is actually placed in the beam, or what modules are accessed from b (aka plumtree_metadata_hashtree) to see where the working code in the test is comming from). I would assume that there is some code_transform going on, but cannot find any in the rebar configuration. Any help appreciated. mfg lutz -- Lutz Behnke Hochschule f?r Angewandte Wissenschaften Hamburg, Labor f?r Allgemeine Informatik, phone: +49 40 42875-8156 mailto:lutz.behnke@REDACTED fax : +49 40 2803770 http://users.informatik.haw-hamburg.de/~sage Berliner Tor 7, 20099 Hamburg, Germany From raimo+erlang-questions@REDACTED Tue Jul 24 16:37:11 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Tue, 24 Jul 2018 16:37:11 +0200 Subject: [erlang-questions] Including function in configuration file In-Reply-To: References: <97239fa3-1e1c-4f6d-899f-f759b7e2964c@Spark> Message-ID: <20180724143711.GA90799@erix.ericsson.se> On Mon, Jul 09, 2018 at 08:50:14PM +0100, Roger Lipscombe wrote: > On 9 July 2018 at 20:16, Code Wiget wrote: > > So, for the ssl options such as: > > {reuse_session, fun()} {next_protocols_advertised, [binary()]} > > > > {user_lookup_fun, {fun(), term()}}, {psk_identity, string()}, {srp_identity, > > {string(), string()}} > > > > You have to manually set the configuration parameters, and cannot set them > > in a configuration file? > > Yes, but you _can_ come up with some other way to specify them in the > configuration file, and then convert that to an actual function before > you pass it to SSL options. > > We have something like this in our code: > > convert_ssl_opt({verify_opts, VerifyOpts}, Acc) -> > Opt = {verify_fun, {fun do_verify/3, VerifyOpts}}, > [Opt | Acc]; > > ...which converts our invented 'verify_opts' into the required > 'verify_fun', by using a do_verify function in the module that does > the conversion. I think that for this option it actuall works write an inline fun as in: Opt = {verify_fun, {fun (A, B, C) -> result end, VerifyOpts}} (If this works) it creates a shell fun that is calls a precompiled fun in the shell module that feeds the abstract code to the interpreter, so it is much slower than a compiled fun. But I think it works and suppose we will not remove this (mis)feature. -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Tue Jul 24 17:01:27 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Tue, 24 Jul 2018 17:01:27 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: Message-ID: <20180724150127.GB90799@erix.ericsson.se> On Sun, Jul 22, 2018 at 02:32:29PM +0200, Lo?c Hoguin wrote: > Neither. > > The problem with this and the list comprehension equivalent > > [io:format("Message: ~s~n", [Msg]) || Msg /= undefined] > > is that it will confuse people who never encountered it before. > > But if one or both of these forms were teached to beginners and everyone > was using them, then there'd be no problem in using them anymore. > > I'd love if they became more popular. I do not mind writing nor reading Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), but find [io:format("Message: ~s~n", [Msg]) || Msg /= undefined] a bit harder to read because the condition comes after the action. I prefer in any case to use two lines with indentation to hint about the flow control usage. (Doesn't Dialyzer complain about the 'andalso' variant because it may return a 'false' that is ignored?) Erlang does not have many "ugly tricks" like these, so if it can save me from 4 uninteresting code lines i certainly do not mind: case Msg of undefined -> ok; _ -> io:format("Message: ~s~n", [Msg]) end > > Cheers, > > On 07/22/2018 02:25 PM, Viktor S?derqvist wrote: > > Hey everyone, > > > > I've seen these short-circuit operators with a non-boolean second > > operand, usually where the second operand is doing some side-effect and > > the return value is not important. It seems to be a trend. Example: > > > > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), > > > > I this good or bad style? > > > > -- > Lo?c Hoguin > https://ninenines.eu -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From ledest@REDACTED Tue Jul 24 16:30:46 2018 From: ledest@REDACTED (Led) Date: Tue, 24 Jul 2018 17:30:46 +0300 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: <20180724122657.376285a4@raspy> References: <2768873.NH1MvFoY5h@takoyaki> <20180724122657.376285a4@raspy> Message-ID: 2018-07-24 13:26 GMT+03:00 : > Why not: > > if Pid =:= WorkerPid -> throw({'task', Task}) end, > > ? > Are you serious? Or is this a joke? -- Led. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan@REDACTED Tue Jul 24 17:16:46 2018 From: ivan@REDACTED (Ivan Uemlianin) Date: Tue, 24 Jul 2018 16:16:46 +0100 Subject: [erlang-questions] Retrieving the dependencies of a module In-Reply-To: <4b8cf1e5-a7a2-f8b4-621d-e00d41215de6@informatik.haw-hamburg.de> References: <4b8cf1e5-a7a2-f8b4-621d-e00d41215de6@informatik.haw-hamburg.de> Message-ID: Does xref do what you need? ??? http://erlang.org/doc/apps/tools/xref_chapter.html Ivan On 24/07/2018 15:33, Lutz Behnke wrote: > Hi there, > > I am trying to find out what other modules the functions in a given > module are calling. Is there a standard mechanism to do so? > > I have the following problem: > > In one application build with rebar3: > > app_one/src/a.erl: > -module(a) > f1() -> b:f2(). > > in the other application, also build with rebar3: > > app_two/src/b.erl: > -module(b) > f2() -> c:f3(). > > > The module c is nowhere defined in either application one, two, or the > dependencies either pulls. > > When I run the tests of application two everything works, when I try > to call the code from the module a, I get: > > ?{failed_to_start_child,b, > ????????? {undef, > ????????????? [{c,f3,[],[]}, > ?????????????? {b,f2,1,[{...}|...]}, > ?????????????? {gen_server,init_it,2,[...]}, > ?????????????? {gen_server,init_it,6,...}, > ?????????????? {proc_lib,init_p_do_apply,...}]}}} > > application two is specifically my fork of plumtree: > ? https://github.com/timadorus/plumtree > > Therefore I am trying to understand what is actually placed in the > beam, or what modules are accessed from b (aka > plumtree_metadata_hashtree) to see where the working code in the test > is comming from). > I would assume that there is some code_transform going on, but cannot > find any in the rebar configuration. > > Any help appreciated. > > mfg lutz -- ============================================================ Ivan A. Uemlianin PhD Llaisdy Ymchwil a Datblygu Technoleg Lleferydd Speech Technology Research and Development ivan@REDACTED @llaisdy llaisdy.wordpress.com github.com/llaisdy www.linkedin.com/in/ivanuemlianin festina lente ============================================================ From nyarly@REDACTED Tue Jul 24 19:37:43 2018 From: nyarly@REDACTED (Judson Lester) Date: Tue, 24 Jul 2018 10:37:43 -0700 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: References: <20180724110243.11f236ce@raspy> Message-ID: To be fair to Michael, there is a legitimate (albeit somewhat tortured) reading of "A can not be done" as "It is possible not to do A" that "A cannot be done" doesn't admit. While I read the patch notes as meaning "It is impossible to apply the kernel application separately", I can see where confusion might arise. On Tue, Jul 24, 2018 at 6:17 AM Marc Worrell wrote: > Hi Michael, > > ?Cannot? and ?can not? are both acceptable spellings. > And there is no difference in meaning. > > See also: > https://www.dailywritingtips.com/cannot-or-can-not/ > > > If it can not be applied independently then it can also be > > applied independently - which, in this case, is [..] > > Could it be that you see ?can not only? where it says ?can not? ? > > - Marc > > > > On 24 Jul 2018, at 11:02, wrote: > > > > This is only the most recent occurrence that finally > > makes me write this: > > > > > > [erlang-questions] Patch package OTP 20.3.8.3 released > > Tue, 24 Jul 2018 09:13:22 +0200 > > [...] > > Note! The kernel-5.4.3.2 application can *not* be applied > > independently of other applications on an arbitrary > > OTP 20 installation. > > [...] > > > > > > If it can not be applied independently then it can also be > > applied independently - which, in this case, is > > probably not what is meant. But this is guesswork, relying > > on the reader already knowing the meaning of what is > > being said, rendering the saying it much less useful. > > > > Modals are a mess (spoken languages are, after ceturies of > > abuse like the one discussed in "[erlang-questions] Orelse > > and andalso as short-hand for case"), but they convey > > critical meaning. > > > > Nine(?) of ten "can not"s in the Erlang docs must be > > "cannot" to convey the correct meaning. Reading the docs has > > already made me convert every "can not" I read into > > "cannot" - I mean *every*, not only those in the Erlang > > docs - and then back again (only about 1 of 10 in the > > Erlang docs). This is a real, and substantial, waste of > > post-orbital CPU cycles; not the conversion itself, but the > > distraction from understanding whatever meaning the author > > actually tries to get across. > > > > If someone with authority (and authorisation) could and > > would please write and run a script and convert all "can > > not" -> "cannot" in all OTP strings, binaries and comments? > > This will introduce errors, as there actually are a few, > > rare correct "can not"s, but it will correct about 9 times > > more of wrong ones that really need to be "cannot". > > > > At least in the doc strings? > > > > Please? > > > > Michael > > > > -- > > > > Time is not money, but money is time: life-time people have > > spent transforming their environment. > > > > > > _______________________________________________ > > 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 lutz.behnke@REDACTED Tue Jul 24 21:35:32 2018 From: lutz.behnke@REDACTED (Lutz Behnke) Date: Tue, 24 Jul 2018 21:35:32 +0200 Subject: [erlang-questions] Retrieving the dependencies of a module In-Reply-To: References: <4b8cf1e5-a7a2-f8b4-621d-e00d41215de6@informatik.haw-hamburg.de> Message-ID: <35d449bd-3745-6716-f300-9b722c7769fe@informatik.haw-hamburg.de> Not really. Instead it deepens my confusion, as it reports the same function as missing in plumtree as it does in my code, despite the CT tests of plumtree working. mfg lutz Am 24.07.2018 um 17:16 schrieb Ivan Uemlianin: > Does xref do what you need? > > ??? http://erlang.org/doc/apps/tools/xref_chapter.html > > Ivan > > > On 24/07/2018 15:33, Lutz Behnke wrote: >> Hi there, >> >> I am trying to find out what other modules the functions in a given >> module are calling. Is there a standard mechanism to do so? >> >> I have the following problem: >> >> In one application build with rebar3: >> >> app_one/src/a.erl: >> -module(a) >> f1() -> b:f2(). >> >> in the other application, also build with rebar3: >> >> app_two/src/b.erl: >> -module(b) >> f2() -> c:f3(). >> >> >> The module c is nowhere defined in either application one, two, or the >> dependencies either pulls. >> >> When I run the tests of application two everything works, when I try >> to call the code from the module a, I get: >> >> ?{failed_to_start_child,b, >> ????????? {undef, >> ????????????? [{c,f3,[],[]}, >> ?????????????? {b,f2,1,[{...}|...]}, >> ?????????????? {gen_server,init_it,2,[...]}, >> ?????????????? {gen_server,init_it,6,...}, >> ?????????????? {proc_lib,init_p_do_apply,...}]}}} >> >> application two is specifically my fork of plumtree: >> ? https://github.com/timadorus/plumtree >> >> Therefore I am trying to understand what is actually placed in the >> beam, or what modules are accessed from b (aka >> plumtree_metadata_hashtree) to see where the working code in the test >> is comming from). >> I would assume that there is some code_transform going on, but cannot >> find any in the rebar configuration. >> >> Any help appreciated. >> >> mfg lutz > -- Lutz Behnke Hochschule f?r Angewandte Wissenschaften Hamburg, Labor f?r Allgemeine Informatik, phone: +49 40 42875-8156 mailto:lutz.behnke@REDACTED fax : +49 40 2803770 http://users.informatik.haw-hamburg.de/~sage Berliner Tor 7, 20099 Hamburg, Germany From empro2@REDACTED Tue Jul 24 21:06:31 2018 From: empro2@REDACTED (empro2@REDACTED) Date: Tue, 24 Jul 2018 21:06:31 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: <2768873.NH1MvFoY5h@takoyaki> <20180724122657.376285a4@raspy> Message-ID: <20180724210631.134a6b3f@raspy> Am Tue, 24 Jul 2018 17:30:46 +0300 schrieb Led : > 2018-07-24 13:26 GMT+03:00 : > > > Why not: > > > > if Pid =:= WorkerPid -> throw({'task', Task}) end, > > > > ? > Are you serious? > Or is this a joke? Sorry! do not attribute to jest what can be explained with simple stupidity - or so the saying goes ... :-) Perhaps it was the mentioning of WHEN and UNLESS (that remove the need for PROGN and the "else" in LISP), perhaps it was seeing the use of a list comprehension without a list producing one that was not wanted, perhaps I was simply trying not to like the "andalso" (which is only possible since R13A http://erlang.org/doc/reference_manual/expressions.html#short-circuit-expressions) or perhaps there is a reason for my "if" being nonsense and that reason is not to be circumvented with "andalso" ... ... but I seem to be too stupid to see that (yet) :-) Michael -- If a bank in need of money is systematically important, then that system is not important. From lutz.behnke@REDACTED Wed Jul 25 09:06:12 2018 From: lutz.behnke@REDACTED (Lutz Behnke) Date: Wed, 25 Jul 2018 09:06:12 +0200 Subject: [erlang-questions] Retrieving the dependencies of a module In-Reply-To: References: <4b8cf1e5-a7a2-f8b4-621d-e00d41215de6@informatik.haw-hamburg.de> <35d449bd-3745-6716-f300-9b722c7769fe@informatik.haw-hamburg.de> Message-ID: <46dd6b49-d278-570f-e7ca-f3bde5d60d3c@informatik.haw-hamburg.de> Please excuse my waste of your time. It is a classical PEBKAC: tests that are never called cannot fail. On the plus side: I learned more about xref, especially the fact, that it analyses the beam file instead of the source code. Thank you for your help. mfg lutz Am 25.07.2018 um 03:07 schrieb Dmitry Belyaev: > Are you sure the plumtree CT tests are executing the code that xref > complains about? > > Kind regards, > Dmitry Belyaev > > On Wed, Jul 25, 2018 at 5:35 AM, Lutz Behnke < > lutz.behnke@REDACTED> wrote: > >> Not really. Instead it deepens my confusion, as it reports the same >> function as missing in plumtree as it does in my code, despite the CT tests >> of plumtree working. >> >> mfg lutz >> >> >> Am 24.07.2018 um 17:16 schrieb Ivan Uemlianin: >> >>> Does xref do what you need? >>> >>> http://erlang.org/doc/apps/tools/xref_chapter.html >>> >>> Ivan >>> >>> >>> On 24/07/2018 15:33, Lutz Behnke wrote: >>> >>>> Hi there, >>>> >>>> I am trying to find out what other modules the functions in a given >>>> module are calling. Is there a standard mechanism to do so? >>>> >>>> I have the following problem: >>>> >>>> In one application build with rebar3: >>>> >>>> app_one/src/a.erl: >>>> -module(a) >>>> f1() -> b:f2(). >>>> >>>> in the other application, also build with rebar3: >>>> >>>> app_two/src/b.erl: >>>> -module(b) >>>> f2() -> c:f3(). >>>> >>>> >>>> The module c is nowhere defined in either application one, two, or the >>>> dependencies either pulls. >>>> >>>> When I run the tests of application two everything works, when I try to >>>> call the code from the module a, I get: >>>> >>>> {failed_to_start_child,b, >>>> {undef, >>>> [{c,f3,[],[]}, >>>> {b,f2,1,[{...}|...]}, >>>> {gen_server,init_it,2,[...]}, >>>> {gen_server,init_it,6,...}, >>>> {proc_lib,init_p_do_apply,...}]}}} >>>> >>>> application two is specifically my fork of plumtree: >>>> https://github.com/timadorus/plumtree >>>> >>>> Therefore I am trying to understand what is actually placed in the beam, >>>> or what modules are accessed from b (aka plumtree_metadata_hashtree) to see >>>> where the working code in the test is comming from). >>>> I would assume that there is some code_transform going on, but cannot >>>> find any in the rebar configuration. >>>> >>>> Any help appreciated. >>>> >>>> mfg lutz >>>> >>> >>> >> >> -- >> Lutz Behnke >> Hochschule f?r Angewandte Wissenschaften Hamburg, >> Labor f?r Allgemeine Informatik, >> >> phone: +49 40 42875-8156 mailto:lutz.behnke@REDACTED >> fax : +49 40 2803770 http://users.informatik.haw-hamburg.de/~sage >> Berliner Tor 7, 20099 Hamburg, Germany >> >> _______________________________________________ >> erlang-questions mailing list >> erlang-questions@REDACTED >> http://erlang.org/mailman/listinfo/erlang-questions >> > -- Lutz Behnke Hochschule f?r Angewandte Wissenschaften Hamburg, Labor f?r Allgemeine Informatik, phone: +49 40 42875-8156 mailto:lutz.behnke@REDACTED fax : +49 40 2803770 http://users.informatik.haw-hamburg.de/~sage Berliner Tor 7, 20099 Hamburg, Germany From raimo+erlang-questions@REDACTED Wed Jul 25 10:02:25 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Wed, 25 Jul 2018 10:02:25 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180724110243.11f236ce@raspy> References: <20180724110243.11f236ce@raspy> Message-ID: <20180725080225.GA62196@erix.ericsson.se> On Tue, Jul 24, 2018 at 11:02:43AM +0200, empro2@REDACTED wrote: > This is only the most recent occurrence that finally > makes me write this: > > > [erlang-questions] Patch package OTP 20.3.8.3 released > Tue, 24 Jul 2018 09:13:22 +0200 > [...] > Note! The kernel-5.4.3.2 application can *not* be applied > ??????independently of other applications on an arbitrary > OTP 20 installation. > [...] > > > If it can not be applied independently then it can also be > applied independently - which, in this case, is > probably not what is meant. But this is guesswork, relying > on the reader already knowing the meaning of what is > being said, rendering the saying it much less useful. > > Modals are a mess (spoken languages are, after ceturies of > abuse like the one discussed in "[erlang-questions] Orelse > and andalso as short-hand for case"), but they convey > critical meaning. > > Nine(?) of ten "can not"s in the Erlang docs must be > "cannot" to convey the correct meaning. Reading the docs has > already made me convert every "can not" I read into > "cannot" - I mean *every*, not only those in the Erlang > docs - and then back again (only about 1 of 10 in the > Erlang docs). This is a real, and substantial, waste of > post-orbital CPU cycles; not the conversion itself, but the > distraction from understanding whatever meaning the author > actually tries to get across. I have tried to get a grip on this (not having English as my native language), and found these sites seems to say that there is no difference in meaning between "cannot" and "can not": https://www.dailywritingtips.com/cannot-or-can-not/ https://english.stackexchange.com/questions/204006/cannot-vs-can-not https://english.stackexchange.com/questions/4510/why-is-cannot-spelled-as-one-word https://www.grammarly.com/blog/cannot-or-can-not/ http://grammarist.com/usage/cannot-or-can-not/ And some of them point out that large dictionaries such as Merriam-Webster and Oxford Dictionaries define "cannot" and "can not" to have the same meaning: https://en.oxforddictionaries.com/definition/cannot https://www.merriam-webster.com/dictionary/cannot But I also found this site says that it is *wrong* to use "can not" as a replacement for "cannot" (although comments besides the article disagrees): https://painintheenglish.com/case/4513/ And this site says to always use "cannot" unless you have to use "can not", but not that it is wrong to do otherwise: https://writingexplained.org/cannot-or-can-not-difference It seems to me that "cannot" and "can not" *has* got the same meaning, but that "can not" must be used in some special cases. And now "cannot" is so much more common to use over "can not" that if you use "can not" where it is not necessary some readers get confused that the use is due to some of the special cases and assumes it has a different meaning. My point of view (until I have to alter it) is: * "The word "can't" is an abbreviation of "cannot" that should only be used in informal text. * The word "cannot" and the phrase "can not" has the same meaning. * The phrase "can not" has to be used when the "not" is part of another phrase; for example "I can not only program in Erlang" where "not" is part of "not only". Another example is "I can or can not program in Erlang" where the "not" belongs to one of the two choices "program" or "not program". I think it is the latter example that has spawned the point of view that "can not 'do something'" could indicate that there is an option to 'do something' anyway, while "cannot 'do something'" would not allow it. * The phrase "can not" _may_ also be used when you want to emphasize the "not" as making a pause when you speak it. But some _may_ find that use confusing. Therefore I do not think that the particular phrase in question: "can *not* be applied" is in error since it emphasizes that the patch really really cannot be applied. But I am not against rewriting all strings, binaries and comments in the Erlang/OTP repository to use "cannot" in favour of "can not" where possible since it the more common usage today, and does not confuse any readers. > > If someone with authority (and authorisation) could and > would please write and run a script and convert all "can > not" -> "cannot" in all OTP strings, binaries and comments? > This will introduce errors, as there actually are a few, > rare correct "can not"s, but it will correct about 9 times > more of wrong ones that really need to be "cannot". > > At least in the doc strings? > > Please? Anyone can clone the OTP repository, make the changes (with a script if desired), and make a pull request on GitHub. > > Michael > > -- > > Time is not money, but money is time: life-time people have > spent transforming their environment. > > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From mrosales@REDACTED Wed Jul 25 10:18:35 2018 From: mrosales@REDACTED (Marcial Rosales) Date: Wed, 25 Jul 2018 10:18:35 +0200 Subject: [erlang-questions] How to pin-point High CPU utilization in Erlang VM In-Reply-To: References: Message-ID: Hi Lukas, sorry for responding this late to you. I dont have yet all the information but I ought to send you a reply. See my replies in-line: On Thu, Jul 19, 2018 at 11:51 AM Lukas Larsson wrote: > Hello, > > On Wed, Jul 18, 2018 at 5:34 AM Marcial Rosales > wrote: > >> We are experiencing a very high cpu utilization in 3 clustered Erlang VMs >> running RabbitMQ. We have deployed another cluster in an attempt to >> reproduce the same behaviour without much success. >> >> Our goals are: >> >> - Find out where the CPU is being utilized >> - Choose the right tools to analyze CPU utilization >> >> >> Our observations so far: >> >> - The *BAD* cluster observes a pretty excessive CPU utilization, both >> user and system ones, and also network. >> - The *BAD* cluster also observes a higher Erlang scheduler >> utilization, specially on microstate emulator and other. We are yet >> to understand what other could be. According to Erlang documentation >> is *unaccounted things*. >> >> If you compile Erlang with "./configure > --with-microstate-accounting=extra" (as suggested by Danil), the other > part will be broken into more granular parts. However, looking at your perf > recordings I would guess that most of the other time is time spent spinning > before going to sleep. > > MR > Thanks! We are going to recompile Erlang with lock counting and extra microstate-accounting. Hopefully we can get more visibility the next time we get a cluster in that bad state. >> - The *BAD* cluster observes a considerably higher number of system >> calls which we are yet to identify (dunno how) why is that. >> >> Maybe use strace and then write some small script that counts the > different syscall made? > MR > The strace reports that 97% of the calls are `futex`, should that helped. > >> >> - The *BAD* cluster does not necessarily run higher number of >> reductions. In fact, the *GOOD* cluster runs more reductions and yet >> has a lower scheduler utilization. >> >> METRICBADGOOD >> user cpu >> 46% >> - 57% 19% - 40% >> system cpu >> 20% >> - 37% 1% - 10% >> network traffic >> 6M >> - 19M up to 8M >> system interrupts >> 120k >> - 196k 10k - 20k >> syscalls >> 1.6M >> - 2.1M 49k - 110k >> task-clock 10sec >> >> 68255 12324 >> cpu profiling info >> >> >> We have gathered lots of metrics in attempt to identify why the BAD >> cluster uses so much CPU. All the information can be found here >> https://gist.github.com/MarcialRosales/226716f0cb9e27cd9ab02eac04702841 >> along with the environment information. >> >> >> In the BAD cluster, would it be possible to see the annotated versions of > process_main and scheduler_wait in the "perf record" run? > There doesn't seem to be any kernel symbols in the BAD cluster perf run, do > you know why? > MR> I dont really know. We are running with the same OS image. Any ideas what could that be? > >> We appreciate a lot any insights as to what could be causing the issue >> and/or in relation to additional tools we could use. >> > My gut tells me that there is some syscall that is a lot slower on XEN > than it is in the KVM. In virtualized environments I always tend to suspect > the time source first. Different hypervisors have very different > performance for getting the time and the Erlang VM does a lot of time > fetching. > > MR> We are in the process of provisioning a cluster in AWS in an attempt to discard or confirm the hypervisor. > Lukas > -- Marcial Rosales Advisory Solution Architect (Customer Success Organization) Pivotal, Inc. EMEA -------------- next part -------------- An HTML attachment was scrubbed... URL: From sean.hinde@REDACTED Wed Jul 25 11:20:48 2018 From: sean.hinde@REDACTED (Sean Hinde) Date: Wed, 25 Jul 2018 11:20:48 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180725080225.GA62196@erix.ericsson.se> References: <20180724110243.11f236ce@raspy> <20180725080225.GA62196@erix.ericsson.se> Message-ID: <4FCCCD8E-6D3D-4BFA-8C09-7F4B5FD1781B@mac.com> > > I have tried to get a grip on this (not having English as my native > language), and found these sites seems to say that there is no difference > in meaning between "cannot" and "can not": > > https://www.dailywritingtips.com/cannot-or-can-not/ > https://english.stackexchange.com/questions/204006/cannot-vs-can-not > https://english.stackexchange.com/questions/4510/why-is-cannot-spelled-as-one-word > https://www.grammarly.com/blog/cannot-or-can-not/ > http://grammarist.com/usage/cannot-or-can-not/ This is a fun one. As a native english speaker here?s my take: Using my son?s homework as an example: He has a choice. He can do it, or he can not do it If he cannot do it he has no choice :) If forced to think I would use cannot in the context used in the release notes, although I have never over the years read that phrase in the release notes as meaning there is a choice in whether it can be applied. Sean -------------- next part -------------- An HTML attachment was scrubbed... URL: From ivan@REDACTED Wed Jul 25 12:07:11 2018 From: ivan@REDACTED (Ivan Uemlianin) Date: Wed, 25 Jul 2018 11:07:11 +0100 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <4FCCCD8E-6D3D-4BFA-8C09-7F4B5FD1781B@mac.com> References: <20180724110243.11f236ce@raspy> <20180725080225.GA62196@erix.ericsson.se> <4FCCCD8E-6D3D-4BFA-8C09-7F4B5FD1781B@mac.com> Message-ID: <2F8EA289-1F4F-4D73-A3E7-B8966ED6AE19@llaisdy.com> Very nice example! I would have thought this ?can not? only acceptable in informal (& perhaps only spoken) English. Formal documents should always use ?cannot?. Ivan (Native British English speaker) -- festina lente > On 25 Jul 2018, at 10:20, Sean Hinde wrote: > >> >> I have tried to get a grip on this (not having English as my native >> language), and found these sites seems to say that there is no difference >> in meaning between "cannot" and "can not": >> >> https://www.dailywritingtips.com/cannot-or-can-not/ >> https://english.stackexchange.com/questions/204006/cannot-vs-can-not >> https://english.stackexchange.com/questions/4510/why-is-cannot-spelled-as-one-word >> https://www.grammarly.com/blog/cannot-or-can-not/ >> http://grammarist.com/usage/cannot-or-can-not/ > > This is a fun one. As a native english speaker here?s my take: > > Using my son?s homework as an example: > > He has a choice. He can do it, or he can not do it > > If he cannot do it he has no choice :) > > If forced to think I would use cannot in the context used in the release notes, > although I have never over the years read that phrase in the release notes as > meaning there is a choice in whether it can be applied. > > Sean > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From empro2@REDACTED Wed Jul 25 12:08:30 2018 From: empro2@REDACTED (empro2@REDACTED) Date: Wed, 25 Jul 2018 12:08:30 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: References: <20180724110243.11f236ce@raspy> Message-ID: <20180725120830.240c18de@raspy> Am Tue, 24 Jul 2018 10:37:43 -0700 schrieb Judson Lester : > To be fair to Michael, there is a legitimate (albeit Need of clarification, opposing arguments, even simple different opinion are all fair for me; but thanks anyway :-) I simply had not expected this, I expected: do it yourself; people from all over the world write this, so there are typoes; we cannot predict what that change would result in, so never change a running documentation; anything but 'it does not change the meaning' or 'what are you talking about?'. > somewhat tortured) reading of "A can not be done" as "It Tortured? without the context? I do not want to say that the meaning cannot be inferred from the context, it may even be more or less obvious. After two notes stating that it is possible to update the applications referred to separately I expected that note to warn of it not being possible with this one. Only experience with the Erlang documentation made me double-check. This is not the best example, it only made me mention the matter at last. > is possible not to do A" that "A cannot be done" doesn't > admit. While I read the patch notes as meaning "It is > impossible to apply the kernel application separately", I > can see where confusion might arise. Can you see it here too? How much torture requires this one from the manual on gen_statem: In this case OldState will be the same as State, which can not happen for a subsequent state change, but will happen when repeating the state enter call. Much, I suppose, but this one with even less context: Note that Reason can not be an {ok,_,_} tuple These do not really help, I should have noted down an example of "can not" that cannot be "cannot" ... But as things appear to be, the solution would be to paraphrase such occurrences instead of "correcting" the other "can not"s that can be "cannot". Michael -- ?Even after a thousand explanations a fool is no wiser, whereas someone intelligent requires only one fourth of these.? ? from the Mah?bh?rata (???????) From empro2@REDACTED Wed Jul 25 12:33:29 2018 From: empro2@REDACTED (empro2@REDACTED) Date: Wed, 25 Jul 2018 12:33:29 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180724131622.GF21293@carfax.org.uk> References: <20180724110243.11f236ce@raspy> <20180724131622.GF21293@carfax.org.uk> Message-ID: <20180725123329.33271121@raspy> Am Tue, 24 Jul 2018 13:16:22 +0000 schrieb Hugo Mills : > On Tue, Jul 24, 2018 at 11:02:43AM +0200, empro2@REDACTED > wrote: > > If it can not be applied independently then it can also > > be applied independently > > Eh? In no way is that the implication here. I know, this is why I continued thus: > > - which, in this case, is > > probably not what is meant. But this is guesswork, Of course this was not pure "guesswork", but I had to backtrack and rule out the wrong meaning, even if only to double-check that the already automatic conversion "can not" -> "cannot" was correct in this case. > "can *not*", to me as a native speaker of the > language, is the same as "cannot", with additional > emphasis. I've been trying to identify other meanings > using alternative readings or logical inference, but none > of them come naturally, or would make any sense. So: "can not do" /= 'able to not do' "can not do" = 'not able to do' "cannot do" = 'not able to do'? Two ways to encode the latter and a need to paraphrase the first one? Is there not a reason for people to have invented "cannot" and (obsolete) "canot" and (slang) "no can": Expression of different semantics with different syntax? > You're asking for a change which makes no difference > whatsoever. No difference between left and right associative "not"? I can (not go to their wedding). (There is no law that makes me have to see that person.) I (cannot) go to their wedding. (I will be on a different* continent on that day.) * I try to avoid "another", as it is ambiguous, though it may "feel" more "natural". "Bring me another beer!" - "Do you want a different kind or only one more?" ;-> I wish I could right now find a "can not" in the docs that cannot be "cannot", to put it in here, but they are so rare ... And I am aware that people on this list do not belong to those myriad of native speakers to whom these sets appear to be semantical equivalents already: ["you're" |"your"], ["then" | "than"], ["there" | "their" | "they're"]. I do not want to add ["cannot" | "can not"] :-) Michael -- Reasonable is that which cannot be criticised reasonably. From max.lapshin@REDACTED Wed Jul 25 12:38:51 2018 From: max.lapshin@REDACTED (Max Lapshin) Date: Wed, 25 Jul 2018 13:38:51 +0300 Subject: [erlang-questions] erlang and systemd: how to combine without nif Message-ID: While migrating to systemd from old good SysV init, I've found that it is a very good idea to speak to this daemon and tell him that my software is alive and ready. systemd authors offer library for this (and I suppose that they want to see these calls in POSIX and all other OS). Petr Lemenkov together with other commiters have written wrapper around this C library: https://github.com/systemd/erlang-sd_notify I was completely against this idea, because I do not want to take nif around library that makes a very simple call, so I've decided to write a code that relies on protocol in this systemd library: https://gist.github.com/maxlapshin/01773f0fca706acdcb4acb77d91d78bb Just drop this file to your source, add systemd as a permanent worker for keepalive to work and don't forget to call systemd:ready to commit start. Service file may look like this: [Unit] Description=Retroview After=network-online.target Wants=network-online.target [Service] Environment=HOME=/var/lib/retroview Environment=PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin Environment=LANG=C Environment=PROCNAME=retroview Type=notify User=root Group=root LimitNOFILE=102400 ExecStartPre=/bin/mkdir -p /var/lib/retroview ExecStartPre=/bin/mkdir -p /var/log/retroview ExecStart=/usr/bin/erl -p /opt/retroview/ebin -noinput -name retroview@REDACTED -s retroview Restart=on-failure TimeoutStartSec=300s WatchdogSec=120 WorkingDirectory=/opt/retroview NotifyAccess=main [Install] WantedBy=multi-user.target -------------- next part -------------- An HTML attachment was scrubbed... URL: From eric.des.courtis@REDACTED Wed Jul 25 13:18:06 2018 From: eric.des.courtis@REDACTED (Eric des Courtis) Date: Wed, 25 Jul 2018 07:18:06 -0400 Subject: [erlang-questions] How to pin-point High CPU utilization in Erlang VM In-Reply-To: References: Message-ID: We've had issues recently with Xen VMs on AWS being much slower than usual. It wasn't even running Erlang. On Wed, Jul 25, 2018, 4:18 AM Marcial Rosales wrote: > Hi Lukas, sorry for responding this late to you. I dont have yet all the > information but I ought to send you a reply. > See my replies in-line: > > On Thu, Jul 19, 2018 at 11:51 AM Lukas Larsson wrote: > >> Hello, >> >> On Wed, Jul 18, 2018 at 5:34 AM Marcial Rosales >> wrote: >> >>> We are experiencing a very high cpu utilization in 3 clustered Erlang >>> VMs running RabbitMQ. We have deployed another cluster in an attempt to >>> reproduce the same behaviour without much success. >>> >>> Our goals are: >>> >>> - Find out where the CPU is being utilized >>> - Choose the right tools to analyze CPU utilization >>> >>> >>> Our observations so far: >>> >>> - The *BAD* cluster observes a pretty excessive CPU utilization, >>> both user and system ones, and also network. >>> - The *BAD* cluster also observes a higher Erlang scheduler >>> utilization, specially on microstate emulator and other. We are yet >>> to understand what other could be. According to Erlang documentation >>> is *unaccounted things*. >>> >>> If you compile Erlang with "./configure >> --with-microstate-accounting=extra" (as suggested by Danil), the other >> part will be broken into more granular parts. However, looking at your perf >> recordings I would guess that most of the other time is time spent spinning >> before going to sleep. >> >> > MR > Thanks! We are going to recompile Erlang with lock counting and extra > microstate-accounting. Hopefully we can get more visibility the next time > we get a cluster in that bad state. > > >>> - The *BAD* cluster observes a considerably higher number of system >>> calls which we are yet to identify (dunno how) why is that. >>> >>> Maybe use strace and then write some small script that counts the >> different syscall made? >> > > MR > The strace reports that 97% of the calls are `futex`, should that > helped. > > >> >>> >>> - The *BAD* cluster does not necessarily run higher number of >>> reductions. In fact, the *GOOD* cluster runs more reductions and yet >>> has a lower scheduler utilization. >>> >>> METRICBADGOOD >>> user cpu >>> 46% >>> - 57% 19% - 40% >>> system cpu >>> 20% >>> - 37% 1% - 10% >>> network traffic >>> 6M >>> - 19M up to 8M >>> system interrupts >>> 120k >>> - 196k 10k - 20k >>> syscalls >>> 1.6M >>> - 2.1M 49k - 110k >>> task-clock 10sec >>> >>> 68255 12324 >>> cpu profiling info >>> >>> >>> We have gathered lots of metrics in attempt to identify why the BAD >>> cluster uses so much CPU. All the information can be found here >>> https://gist.github.com/MarcialRosales/226716f0cb9e27cd9ab02eac04702841 >>> along with the environment information. >>> >>> >>> In the BAD cluster, would it be possible to see the annotated versions >> of process_main and scheduler_wait in the "perf record" run? >> > There doesn't seem to be any kernel symbols in the BAD cluster perf run, >> do you know why? >> > > MR> I dont really know. We are running with the same OS image. Any ideas > what could that be? > > >> >>> We appreciate a lot any insights as to what could be causing the issue >>> and/or in relation to additional tools we could use. >>> >> My gut tells me that there is some syscall that is a lot slower on XEN >> than it is in the KVM. In virtualized environments I always tend to suspect >> the time source first. Different hypervisors have very different >> performance for getting the time and the Erlang VM does a lot of time >> fetching. >> >> MR> We are in the process of provisioning a cluster in AWS in an attempt > to discard or confirm the hypervisor. > > >> Lukas >> > > > -- > Marcial Rosales > Advisory Solution Architect (Customer Success Organization) > Pivotal, Inc. EMEA > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From empro2@REDACTED Wed Jul 25 13:50:54 2018 From: empro2@REDACTED (empro2@REDACTED) Date: Wed, 25 Jul 2018 13:50:54 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: References: <20180724110243.11f236ce@raspy> Message-ID: <20180725135054.7e99e909@raspy> Am Tue, 24 Jul 2018 15:17:10 +0200 schrieb Marc Worrell : > ?Cannot? and ?can not? are both acceptable spellings. With "spellings" = 'symbols', OK, with 'encodings for the same meaning': I am used to something else :-) > And there is no difference in meaning. There used to be - at least. > See also: > https://www.dailywritingtips.com/cannot-or-can-not/ So I see: hmm ... BA, PhD ... might be worthwhile ... Although my personal Error Alarm buzzes whenever I see cannot written as two words, both forms are acceptable usage. Is "Error Alarm" a trademark? why the capitals? who cares ... But it does buzz, so "can not" must at least be unusual in your idiolect. Both forms are acceptable A strange conclusion drawn from a buzzing alarm, but this is a contrast that started with "Although", so: who cares ... Yes, of course, the "forms" (words? symbols?) are, but for what meanings? And this is a mere claim - but the following text will surely support this claim, so: Merriam-Webster lists "cannot" as one word. And looking up "can not" has you see "cannot"? Que? These oppose your claim. This must be one more contrast, so: OED, cannot is the ordinary modern way of writing can not For which meaning? historical illustrations given for the negative in the OED shows cannot, can not, and even canot Whethir it be thus or non I can not say. So apart from the ordinary modern way of writing 'whether' you want to say that it is also acceptable to encode it as "whethir"? or what? This is from century 15 or 16 and etymological proof of obsolete "forms" hardly supports your claim - not as much as it opposes it. The experts at AskOxford seem to prefer cannot What an analysis of: Both cannot and can not are acceptable spellings but the first is much more usual. Yes, more usual, more frequent, but for which meanings? You would use "can not" when the ?not? forms part of another construction such as ?not only.? At last! meaning! - but opposing your claim - again. If the "not" forms part of a different construction, it is not part of the "can", it is right-associative. If such a construction happens to be preceded by a "can", it does not change the meaning of "can" but is itself modified by it, becomes an ability, a choice, an option. Any resulting "can not" is a mere collocation of two words, not an acceptable alternative spelling of "cannot". Why do you keep contradicting your own premise ...? The Washington State University language site says: These two spellings [cannot/can not] are largely interchangeable OK, support, at last (though it looks like ['(cannot/can) not'] due to the missing space around the solidus, but that does not make sense and who cares about typography anyway, so: backtrack), but lo! but by far the most common is ?cannot? So: puff! *support vanishes in a cloud of smoke* (not completely, I admit) you should probably use it "should probably"? Like: 'roll dice'? or 'do not ask me'? except when you want to be emphatic: ?No, you can not wash the dog in the Maytag.? Sounds like "Yes, I can!" - "No, you can'not!" (with the ' imitating an IPA emphasis mark). So the sole exception is merely a badly encoded shift of emphasis in the pronunciation of the word "cannot". Do they also suggest we now write "No, im port, not ex port"? Bottom line There?s no difference in meaning between cannot and can not. Well, yes, there is and more than "largely" and more certainly than "probably" - and according to your own argumentation. One of the only two more or less supporting arguments is clearly restricted to a wish of expressing emphasis. And it is not complete: "Yes, you can 'not wash the dog and go fishing instead, but then I will have it washed professionally and you will have to pay the bill." (Which is not so bad in Washington state, as there one can pay bills with bills ;-) > Could it be that you see ?can not only? where it says > ?can not? ? I see someone telling me of an option to omit, a possibility of not doing, an ability to avoid. Why did I get along for 30 years and only now (2 or 3 years?), reading the Erlang docs, my mapping crumbles? I think the "largely" in that article above is even larger and the "probably" almost 'always' - but not for much longer as colloquial usage seems to have changed already. Languages do change (and there are words that mean one thing and the opposite) but rendering of such prosodic emphasis like that in the example above is not part of the Erlang documentation, nor should it be. The modal verbs and "not" convey much too much meaning to become poetic and mess around with them. But it appears I am too late - and old, and my idiolect may be outdated or outdating (which is not to be confused with "out dating" ;-). People think there was a "must not" but there is not: there is only a "must" = 'have to' used in both 'must (do)' and 'must (not do)'; the obligation itself is never negated: "must not go" = 'have to stay', /= 'do not have to go'. Though the syntax suggests left associativeness of the "not", even "mustn't do" solely means 'have to (not do)'. Or am I already outdated here too? Does anyone here happen to read "can not do" = '(not able to) do' "must not do" = '(not have to) do'? This one http://www.ietf.org/rfc/rfc2119.txt defines neither CAN nor CANNOT nor CAN NOT. To avoid all this confusion? But if people with a BA in English and a PhD in literature write "dailywritingtips" like the one I commented on above: who cares? :-) Michael -- If a bank in need of money is systematically important, then that system is not important. From attila.r.nohl@REDACTED Wed Jul 25 17:49:21 2018 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Wed, 25 Jul 2018 17:49:21 +0200 Subject: [erlang-questions] SSL doesn't like my private key with password Message-ID: Hello! I'm trying to start an SSL server with a key I got (i.e. I don't know exactly how it was configured) that has a password. The password is OK because I can start a server using these keys, certificates and password using openssl. This is how I'm trying (it's OTP 19): 2> {ok, LS} = ssl:listen(12345, [{password, "password"}, {keyfile, "node.key.pem"}, {certfile, "node.cert.pem"}, {cacertfile, "ca-chain.cert.pem"}]). {ok,{sslsocket,nil,... 3> {ok, TS} = ssl:transport_accept(LS). {ok,{sslsocket,... Then I connect to the socket using openssl s_client, then want to accept the connection on the Erlang side: 4> ssl:ssl_accept(TS). {error,{keyfile,function_clause}} I guess it shouldn't happen. I found a question at stackoverflow with similar contents: https://stackoverflow.com/questions/50813212/erlang-ssl-password-option-for-private-key and also a similar problem with RabbitMQ: https://groups.google.com/forum/#!topic/rabbitmq-users/dW3Lz6omyfw Is there a solution (other than using a different SSL private key or upgrade to a newer OTP)? From v@REDACTED Thu Jul 26 02:38:32 2018 From: v@REDACTED (Valentin Micic) Date: Thu, 26 Jul 2018 02:38:32 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180724110243.11f236ce@raspy> References: <20180724110243.11f236ce@raspy> Message-ID: <73E3D3A8-02CA-4D0D-8EBB-EFA896D68527@pharos-corp.com> On 24 Jul 2018, at 11:02 AM, wrote: > This is only the most recent occurrence that finally > makes me write this: > > > [erlang-questions] Patch package OTP 20.3.8.3 released > Tue, 24 Jul 2018 09:13:22 +0200 > [...] > Note! The kernel-5.4.3.2 application can *not* be applied > independently of other applications on an arbitrary > OTP 20 installation. > [...] > > > If it can not be applied independently then it can also be > applied independently - which, in this case, is > probably not what is meant. But this is guesswork, relying > on the reader already knowing the meaning of what is > being said, rendering the saying it much less useful. True. It takes a bit of effort to see it that way, though. However, I think it is a bit of an exaggeration to say that it is relying on the reader already knowing of what is being said. For most of us, non-native English speakers, English does not always make much sense... but we cannot not speak it, can we now? V/ From john@REDACTED Thu Jul 26 10:05:48 2018 From: john@REDACTED (John =?ISO-8859-1?Q?H=F6gberg?=) Date: Thu, 26 Jul 2018 10:05:48 +0200 Subject: [erlang-questions] Patch package OTP 21.0.4 released Message-ID: <1532592348.28544.4.camel@erlang.org> Patch Package:???????????OTP 21.0.4 Git Tag:?????????????????OTP-21.0.4 Date:????????????????????2018-07-26 Trouble Report Id:???????OTP-15169, OTP-15184, OTP-15196 Seq num:???????????????? System:??????????????????OTP Release:?????????????????21 Application:?????????????erts-10.0.4 Predecessor:?????????????OTP 21.0.3 ?Check out the git tag OTP-21.0.4, 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-10.0.4 ----------------------------------------------------- ?--------------------------------------------------------------------- ?The erts-10.0.4 application can be applied independently of other ?applications on a full OTP 21 installation. ?--- Fixed Bugs and Malfunctions --- ? OTP-15169????Application(s): erts ???????????????Fixed a bug that prevented the noshell option from ???????????????working correctly on Mac OS X and BSD. ? OTP-15184????Application(s): erts ???????????????Fixed a crash when matching directly against a literal ???????????????map using a single key that had been saved on the ???????????????stack. ? OTP-15196????Application(s): erts ???????????????Fix node crash when passing a bad time option to ???????????????file:read_file_info/2. ?Full runtime dependencies of erts-10.0.4: kernel-6.0, sasl-3.0.1, ?stdlib-3.5 ?--------------------------------------------------------------------- ?--------------------------------------------------------------------- ?--------------------------------------------------------------------- From attila.r.nohl@REDACTED Thu Jul 26 10:32:04 2018 From: attila.r.nohl@REDACTED (Attila Rajmund Nohl) Date: Thu, 26 Jul 2018 10:32:04 +0200 Subject: [erlang-questions] SSL doesn't like my private key with password In-Reply-To: References: Message-ID: Attila Rajmund Nohl ezt ?rta (id?pont: 2018. j?l. 25., Sze, 17:49): [...] > 4> ssl:ssl_accept(TS). > {error,{keyfile,function_clause}} > > I guess it shouldn't happen. I found a question at stackoverflow with > similar contents: > https://stackoverflow.com/questions/50813212/erlang-ssl-password-option-for-private-key > and also a similar problem with RabbitMQ: > https://groups.google.com/forum/#!topic/rabbitmq-users/dW3Lz6omyfw After some debugging it turned out the error comes from the public key decoding: ** exception error: no function clause matching pubkey_pbe:decode(..., "password","AES-256-CBC", ...) (pubkey_pbe.erl, line 59) Erlang doesn't seem to support the AES-256-CBC cipher for passwords. I see this(?) cipher in ssl, so I guess there's no legal reason not to include it for keys. From mikpelinux@REDACTED Thu Jul 26 10:35:42 2018 From: mikpelinux@REDACTED (Mikael Pettersson) Date: Thu, 26 Jul 2018 10:35:42 +0200 Subject: [erlang-questions] Patch package OTP 21.0.4 released In-Reply-To: <1532592348.28544.4.camel@erlang.org> References: <1532592348.28544.4.camel@erlang.org> Message-ID: Did you forget to push the tag? I can see a branch update but not the new tag in github's otp repo. On Thu, Jul 26, 2018 at 10:05 AM, John H?gberg wrote: > Patch Package: OTP 21.0.4 > Git Tag: OTP-21.0.4 > Date: 2018-07-26 > Trouble Report Id: OTP-15169, OTP-15184, OTP-15196 > Seq num: > System: OTP > Release: 21 > Application: erts-10.0.4 > Predecessor: OTP 21.0.3 > > Check out the git tag OTP-21.0.4, 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-10.0.4 ----------------------------------------------------- > --------------------------------------------------------------------- > > The erts-10.0.4 application can be applied independently of other > applications on a full OTP 21 installation. > > --- Fixed Bugs and Malfunctions --- > > OTP-15169 Application(s): erts > > Fixed a bug that prevented the noshell option from > working correctly on Mac OS X and BSD. > > > OTP-15184 Application(s): erts > > Fixed a crash when matching directly against a literal > map using a single key that had been saved on the > stack. > > > OTP-15196 Application(s): erts > > Fix node crash when passing a bad time option to > file:read_file_info/2. > > > Full runtime dependencies of erts-10.0.4: kernel-6.0, sasl-3.0.1, > stdlib-3.5 > > > --------------------------------------------------------------------- > --------------------------------------------------------------------- > --------------------------------------------------------------------- > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions From john@REDACTED Thu Jul 26 12:14:21 2018 From: john@REDACTED (John =?ISO-8859-1?Q?H=F6gberg?=) Date: Thu, 26 Jul 2018 12:14:21 +0200 Subject: [erlang-questions] Patch package OTP 21.0.4 released In-Reply-To: References: <1532592348.28544.4.camel@erlang.org> Message-ID: <1532600061.28544.5.camel@erlang.org> Good catch! /John On tor, 2018-07-26 at 10:35 +0200, Mikael Pettersson wrote: > Did you forget to push the tag???I can see a branch update but not > the > new tag in github's otp repo. > > On Thu, Jul 26, 2018 at 10:05 AM, John H?gberg > wrote: > > > > Patch Package:???????????OTP 21.0.4 > > Git Tag:?????????????????OTP-21.0.4 > > Date:????????????????????2018-07-26 > > Trouble Report Id:???????OTP-15169, OTP-15184, OTP-15196 > > Seq num: > > System:??????????????????OTP > > Release:?????????????????21 > > Application:?????????????erts-10.0.4 > > Predecessor:?????????????OTP 21.0.3 > > > > ?Check out the git tag OTP-21.0.4, 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-10.0.4 -------------------------------------------------- > > --- > > ?---------------------------------------------------------------- > > ----- > > > > ?The erts-10.0.4 application can be applied independently of other > > ?applications on a full OTP 21 installation. > > > > ?--- Fixed Bugs and Malfunctions --- > > > > ? OTP-15169????Application(s): erts > > > > ???????????????Fixed a bug that prevented the noshell option from > > ???????????????working correctly on Mac OS X and BSD. > > > > > > ? OTP-15184????Application(s): erts > > > > ???????????????Fixed a crash when matching directly against a > > literal > > ???????????????map using a single key that had been saved on the > > ???????????????stack. > > > > > > ? OTP-15196????Application(s): erts > > > > ???????????????Fix node crash when passing a bad time option to > > ???????????????file:read_file_info/2. > > > > > > ?Full runtime dependencies of erts-10.0.4: kernel-6.0, sasl-3.0.1, > > ?stdlib-3.5 > > > > > > ?---------------------------------------------------------------- > > ----- > > ?---------------------------------------------------------------- > > ----- > > ?---------------------------------------------------------------- > > ----- > > _______________________________________________ > > 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 viktor@REDACTED Thu Jul 26 14:05:56 2018 From: viktor@REDACTED (=?UTF-8?Q?Viktor_S=c3=b6derqvist?=) Date: Thu, 26 Jul 2018 14:05:56 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: Message-ID: <255f4ab3-ed58-3af2-d822-c3e60502b8a7@zuiderkwast.se> Thank you all for the diverse opinions! Especially, I liked this point from Dmitry Kolesnikov: > Long time ago, I?ve used andalso syntax but it never stays longer at > code repository due to readability. It has been refactored to > function(s) with guards or pattern match. I think it is the process from prototyping to maintained code. Refactoring involves gradually adding names to things by introducing functions, adding specs and rewriting hacks into proper solutions. A spec with a return type like false | ok | {error, Reason} would make me reconsider the andalso trick. I guess this process gradually makes the code change style from dynamically typed style (LISP, Perl) to statically typed style (ML, Haskell). I find this interesting. Viktor On 2018-07-22 14:25, Viktor S?derqvist wrote: > Hey everyone, > > I've seen these short-circuit operators with a non-boolean second > operand, usually where the second operand is doing some side-effect and > the return value is not important. It seems to be a trend. Example: > > Msg /= undefined andalso io:format("Message: ~s~n", [Msg]), > > I this good or bad style? > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From raimo+erlang-questions@REDACTED Thu Jul 26 15:11:47 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Thu, 26 Jul 2018 15:11:47 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180724110243.11f236ce@raspy> References: <20180724110243.11f236ce@raspy> Message-ID: <20180726131147.GA94922@erix.ericsson.se> Please have a look at and evaluate GitHub PR#1891: https://github.com/erlang/otp/pull/1891 On Tue, Jul 24, 2018 at 11:02:43AM +0200, empro2@REDACTED wrote: > This is only the most recent occurrence that finally > makes me write this: > > > [erlang-questions] Patch package OTP 20.3.8.3 released > Tue, 24 Jul 2018 09:13:22 +0200 > [...] > Note! The kernel-5.4.3.2 application can *not* be applied > ??????independently of other applications on an arbitrary > OTP 20 installation. > [...] > > > If it can not be applied independently then it can also be > applied independently - which, in this case, is > probably not what is meant. But this is guesswork, relying > on the reader already knowing the meaning of what is > being said, rendering the saying it much less useful. > > Modals are a mess (spoken languages are, after ceturies of > abuse like the one discussed in "[erlang-questions] Orelse > and andalso as short-hand for case"), but they convey > critical meaning. > > Nine(?) of ten "can not"s in the Erlang docs must be > "cannot" to convey the correct meaning. Reading the docs has > already made me convert every "can not" I read into > "cannot" - I mean *every*, not only those in the Erlang > docs - and then back again (only about 1 of 10 in the > Erlang docs). This is a real, and substantial, waste of > post-orbital CPU cycles; not the conversion itself, but the > distraction from understanding whatever meaning the author > actually tries to get across. > > If someone with authority (and authorisation) could and > would please write and run a script and convert all "can > not" -> "cannot" in all OTP strings, binaries and comments? > This will introduce errors, as there actually are a few, > rare correct "can not"s, but it will correct about 9 times > more of wrong ones that really need to be "cannot". > > At least in the doc strings? > > Please? > > Michael > > -- > > Time is not money, but money is time: life-time people have > spent transforming their environment. > > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From bchesneau@REDACTED Thu Jul 26 17:47:37 2018 From: bchesneau@REDACTED (Benoit Chesneau) Date: Thu, 26 Jul 2018 17:47:37 +0200 Subject: [erlang-questions] erlang and systemd: how to combine without nif In-Reply-To: References: Message-ID: nice one. Thanks! beno?t On Wed, Jul 25, 2018 at 12:38 PM Max Lapshin wrote: > While migrating to systemd from old good SysV init, I've found that it is > a very good idea to speak to this daemon and tell him that my software is > alive and ready. > > > systemd authors offer library for this (and I suppose that they want to > see these calls in POSIX and all other OS). > > Petr Lemenkov together with other commiters have written wrapper around > this C library: https://github.com/systemd/erlang-sd_notify > > I was completely against this idea, because I do not want to take nif > around library that makes a very simple call, so I've decided to write a > code that relies on protocol in this systemd library: > > > https://gist.github.com/maxlapshin/01773f0fca706acdcb4acb77d91d78bb > > Just drop this file to your source, add systemd as a permanent worker for > keepalive to work and don't forget to call systemd:ready to commit start. > > > Service file may look like this: > > > > [Unit] > Description=Retroview > After=network-online.target > Wants=network-online.target > > [Service] > Environment=HOME=/var/lib/retroview > Environment=PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin > Environment=LANG=C > Environment=PROCNAME=retroview > Type=notify > User=root > Group=root > LimitNOFILE=102400 > ExecStartPre=/bin/mkdir -p /var/lib/retroview > ExecStartPre=/bin/mkdir -p /var/log/retroview > ExecStart=/usr/bin/erl -p /opt/retroview/ebin -noinput -name > retroview@REDACTED -s retroview > Restart=on-failure > TimeoutStartSec=300s > WatchdogSec=120 > WorkingDirectory=/opt/retroview > NotifyAccess=main > > [Install] > WantedBy=multi-user.target > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From comptekki@REDACTED Thu Jul 26 18:24:36 2018 From: comptekki@REDACTED (Wes James) Date: Thu, 26 Jul 2018 10:24:36 -0600 Subject: [erlang-questions] erlang 21.0.4 with wx/no java/no odbc on freebsd Message-ID: If you want to try erlang on freebsd from source: alias pi='sudo pkg install' pi wget autoconf gmake wx30-gtk2 cd /usr/local/bin sudo ln -s wxgtk2u-3.0-config wx-config cd mkdir downloads cd downloads/ wget https://github.com/erlang/otp/archive/OTP-21.0.4.tar.gz tar -zxf OTP-21.0.4.tar.gz cd otp-OTP-21.0.4/ time ./otp_build autoconf time ./configure time gmake time sudo gmake install Test that wx works: erl Erlang/OTP 21 [erts-10.0.4] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [hipe] Eshell V10.0.4 (abort with ^G) 1> wx:demo(). --------- -wes -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Fri Jul 27 01:52:59 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Fri, 27 Jul 2018 08:52:59 +0900 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: Message-ID: <1566729.RM7CrWi6sU@takoyaki> For whatever reason, Richard's responses never made it into the archive. I believe they are worthy of preservation. -Craig On 2018?7?25???? 15?00?03? JST Richard O'Keefe wrote: > Pierre Fenoli does not "understand the strong answers". > I imagine that other people have had the experience of having to maintain > someone else's code, and after a long struggle to disentangle unduly > "clever" > code found themselves shouting "Why did this offspring of an incestuous > union between two male naked mole-rats not remove xer hands from xer > genitals long enough to write down what xie actually meant and NOT WASTE > MY RAPIDLY DWINDLING TIME?" > > I am still nowhere near as good a programmer as I would like to be. > I need to make my own code clearer. > "What is hateful to you, do not do to others." > If anyone catches me abusing short-circuit operations, my apologies > in advance. > > The andalso and orelse operators are defined in section 8.14 > http://erlang.org/doc/reference_manual/expressions.html#short-circuit-expressions > of the Erlang reference manual. It is clear from that that > these operators originally required their right operand to yield > true or false, and were only changed in order to allow code like > > > ismember(X, [Y|Ys]) -> X == Y orelse ismember(X, Ys); > ismember(_, [] ) -> false. > > to be tail recursive. > > It would be really nice if the Dialyzer would warn about misuses of > these operators. What about the 'legit example' we were offered? > It is a blemish in an otherwise pleasant file in an impressive and > useful project. The only occurrence of 'andalso' in that 628 line > file is a good example of when NOT to use 'andalso'. > > task_by_pid(Pid, #state{tasks = Tasks}) -> > F = fun (_, #{worker_pid := WorkerPid}=Task, Acc) -> > Pid =:= WorkerPid > andalso throw({'task', Task}), > Acc > end, > try maps:fold(F, 'undefined', Tasks) > catch 'throw':{'task', Task} -> Task > end. > > which is 9 lines. It garden-paths the reader into a > sort of double negation. The goal of F is *not* to return Acc, > but to find a Task, and the throw is *not* there to report > failure, but success. > > This can be written, not only without 'andalso', > but also without 'throw' and 'catch', as > > task_by_id(Pid, #state{tasks = Tasks}) -> > task_with_matching_worker_pid(Pid, Tasks). > > task_with_matching_worker_pid(Pid, [Task = #{worker_pid := Pid}|_]) -> > Task; > task_with_matching_worker_pid(Pid, [_|Tasks]) -> > task_with_matching_worker_pid(Pid, Tasks); > task_with_matching_worker_pid(_, []) -> > undefined. > > which is also 9 lines. To me this is a fairly obvious linear > search for a matching list element, which leaves me free to > think about things like whether a map from worker Pids to Tasks > might not be a better data structure, and also lets me muse, > "hmm, isn't there already a library function to look for the > first matching list element? Oh yeah." > > task_by_pid(Pid, #state{tasks = Tasks}) -> > case lists:search(fun (#{worker_pid := Id}) -> Id =:= Pid end, Tasks) > of {value, Task} -> Task > ; false -> undefined > end. > > which is now 5 lines, and is how I'd have written it in the first place. > > I honestly wasn't expecting this. Given that this was Kazoo, I > was expecting to have to mumble and shuffle and say "well, maybe > OCCASIONALLY you can get away with it in otherwise really good > code", but the abuse of 'andalso' DID turn out to be a 'code smell' > pointing to contorted code that needed rewriting. > > If, as would not be surprising, I have misunderstood thpe original > code, that just proves my point that it was contorted. > From zxq9@REDACTED Fri Jul 27 01:54:24 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Fri, 27 Jul 2018 08:54:24 +0900 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: References: Message-ID: <1574749.HRntG1FLKk@takoyaki> On 2018?7?25???? 15?09?28? JST Richard O'Keefe wrote: > On 25 July 2018 at 00:06, Nathaniel Waisbrot wrote: > > > if the language hands me a tool and I see a convenient use for it, why > > should I hold back? > > > > Out of consideration for anyone reading the code in the future, > including yourself. The language hands you many tools; if you > need a chisel and you *have* a chisel, why use a screwdriver? > > Or as Dr Johnson put it, "Read over your compositions, and > wherever you meet with a passage which you think is particularly > fine, strike it out." This painful guideline saves me much torment every time I find the fortitude to apply it. -Craig From per@REDACTED Fri Jul 27 08:37:44 2018 From: per@REDACTED (Per Hedeland) Date: Fri, 27 Jul 2018 08:37:44 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: <1566729.RM7CrWi6sU@takoyaki> References: <1566729.RM7CrWi6sU@takoyaki> Message-ID: <9e0a38c6-a1fc-e5e3-a8c4-2db9a07e1754@hedeland.org> On 2018-07-27 01:52, zxq9@REDACTED wrote: > For whatever reason, Richard's responses never made it into the archive. Actually, it seems his messages consistently do not even reach the *list*, and are seen only when quoted in other messages - is there some broken filter on the list, or is he intentionally doing reply-to-sender-only? (Or did he just switch to a mail client that needs "Reply-To: "? And no, let's not start that discussion again...) > I believe they are worthy of preservation. +1!:-) --Per From raimo+erlang-questions@REDACTED Fri Jul 27 09:52:25 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Fri, 27 Jul 2018 09:52:25 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180726131147.GA94922@erix.ericsson.se> References: <20180724110243.11f236ce@raspy> <20180726131147.GA94922@erix.ericsson.se> Message-ID: <20180727075225.GA78257@erix.ericsson.se> On Thu, Jul 26, 2018 at 03:11:47PM +0200, Raimo Niskanen wrote: > Please have a look at and evaluate GitHub PR#1891: > > https://github.com/erlang/otp/pull/1891 Fun story: A coworker just vaguely remembered that the technical writer(s) we had working on the documentation in late 2016 maybe made this kind of changes, and surely enough they did change "can not" into "cannot". This did not stick in all developers' memory, though, since at least 6 of us has re-introduced "can not"s after that. It is actually a hard one, I think especially for Swedes, since we have an ongoing language war/debate about people splitting Swedish words that should be concatenated due to influence from English so the safe bet for a Swede is that in proper English it is probably not one word. I asked around me and the most common reaction is: "cannot" - is that even a proper word? I would have written "can not"! And this is from people born in the 60:s through the 90:s, at least. So it will take a while for this detail to become common truth, at least in Sweden... We will work on it, but it will take time. Best Regards / Raimo > > > On Tue, Jul 24, 2018 at 11:02:43AM +0200, empro2@REDACTED wrote: > > This is only the most recent occurrence that finally > > makes me write this: > > > > > > [erlang-questions] Patch package OTP 20.3.8.3 released > > Tue, 24 Jul 2018 09:13:22 +0200 > > [...] > > Note! The kernel-5.4.3.2 application can *not* be applied > > ??????independently of other applications on an arbitrary > > OTP 20 installation. > > [...] > > > > > > If it can not be applied independently then it can also be > > applied independently - which, in this case, is > > probably not what is meant. But this is guesswork, relying > > on the reader already knowing the meaning of what is > > being said, rendering the saying it much less useful. > > > > Modals are a mess (spoken languages are, after ceturies of > > abuse like the one discussed in "[erlang-questions] Orelse > > and andalso as short-hand for case"), but they convey > > critical meaning. > > > > Nine(?) of ten "can not"s in the Erlang docs must be > > "cannot" to convey the correct meaning. Reading the docs has > > already made me convert every "can not" I read into > > "cannot" - I mean *every*, not only those in the Erlang > > docs - and then back again (only about 1 of 10 in the > > Erlang docs). This is a real, and substantial, waste of > > post-orbital CPU cycles; not the conversion itself, but the > > distraction from understanding whatever meaning the author > > actually tries to get across. > > > > If someone with authority (and authorisation) could and > > would please write and run a script and convert all "can > > not" -> "cannot" in all OTP strings, binaries and comments? > > This will introduce errors, as there actually are a few, > > rare correct "can not"s, but it will correct about 9 times > > more of wrong ones that really need to be "cannot". > > > > At least in the doc strings? > > > > Please? > > > > Michael > > > > -- > > > > Time is not money, but money is time: life-time people have > > spent transforming their environment. > > > > > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From anders.gs.svensson@REDACTED Fri Jul 27 12:24:46 2018 From: anders.gs.svensson@REDACTED (anders.gs.svensson@REDACTED) Date: Fri, 27 Jul 2018 12:24:46 +0200 Subject: [erlang-questions] erlang 21.0.4 with wx/no java/no odbc on freebsd In-Reply-To: References: Message-ID: <23386.62190.442459.59692@gargle.gargle.HOWL> Better, use something like configure --with-wx-config=/usr/pkg/bin/wx-config-3.0 to communicate the relevant path. Anders erlang-questions-request@REDACTED writes: > Date: Thu, 26 Jul 2018 10:24:36 -0600 > From: Wes James > To: erlang questions > Subject: [erlang-questions] erlang 21.0.4 with wx/no java/no odbc on > freebsd > > If you want to try erlang on freebsd from source: > > > alias pi='sudo pkg install' > > pi wget autoconf gmake wx30-gtk2 > cd /usr/local/bin > sudo ln -s wxgtk2u-3.0-config wx-config > > cd > mkdir downloads > cd downloads/ > wget https://github.com/erlang/otp/archive/OTP-21.0.4.tar.gz > tar -zxf OTP-21.0.4.tar.gz > cd otp-OTP-21.0.4/ > time ./otp_build autoconf > time ./configure > time gmake > time sudo gmake install > > Test that wx works: > > erl > > Erlang/OTP 21 [erts-10.0.4] [source] [64-bit] [smp:2:2] [ds:2:2:10] > [async-threads:1] [hipe] > > Eshell V10.0.4 (abort with ^G) > 1> wx:demo(). > > --------- > > -wes From comptekki@REDACTED Fri Jul 27 16:05:27 2018 From: comptekki@REDACTED (Wes James) Date: Fri, 27 Jul 2018 08:05:27 -0600 Subject: [erlang-questions] erlang 21.0.4 with wx/no java/no odbc on freebsd In-Reply-To: <23386.62190.442459.59692@gargle.gargle.HOWL> References: <23386.62190.442459.59692@gargle.gargle.HOWL> Message-ID: Ah, yes. I should have looked to see if there was a "configure" option. Thanks for the tip! On Fri, Jul 27, 2018 at 4:24 AM, wrote: > Better, use something like > > configure --with-wx-config=/usr/pkg/bin/wx-config-3.0 > > to communicate the relevant path. > > Anders > > > > erlang-questions-request@REDACTED writes: > > Date: Thu, 26 Jul 2018 10:24:36 -0600 > > From: Wes James > > To: erlang questions > > Subject: [erlang-questions] erlang 21.0.4 with wx/no java/no odbc on > > freebsd > > > > If you want to try erlang on freebsd from source: > > > > > > alias pi='sudo pkg install' > > > > pi wget autoconf gmake wx30-gtk2 > > cd /usr/local/bin > > sudo ln -s wxgtk2u-3.0-config wx-config > > > > cd > > mkdir downloads > > cd downloads/ > > wget https://github.com/erlang/otp/archive/OTP-21.0.4.tar.gz > > tar -zxf OTP-21.0.4.tar.gz > > cd otp-OTP-21.0.4/ > > time ./otp_build autoconf > > time ./configure > > time gmake > > time sudo gmake install > > > > Test that wx works: > > > > erl > > > > Erlang/OTP 21 [erts-10.0.4] [source] [64-bit] [smp:2:2] [ds:2:2:10] > > [async-threads:1] [hipe] > > > > Eshell V10.0.4 (abort with ^G) > > 1> wx:demo(). > > > > --------- > > > > -wes > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From devon.c.estes@REDACTED Fri Jul 27 20:35:17 2018 From: devon.c.estes@REDACTED (Devon Estes) Date: Fri, 27 Jul 2018 20:35:17 +0200 Subject: [erlang-questions] Memory usage in OTP 21 In-Reply-To: <953b1a28-e8e4-706f-8af7-412efc4320f0@gmail.com> References: <953b1a28-e8e4-706f-8af7-412efc4320f0@gmail.com> Message-ID: I now have an idea as to what's going on here. While looking at a function that uses a little bit more memory, we're not getting any tracing messages that indicate garbage collection is happening. And yet, when I check the process's garbage collection info immediately after executing the function, I see this: [ old_heap_block_size: 610, heap_block_size: 376, mbuf_size: 0, recent_size: 100, stack_size: 14, old_heap_size: 58, heap_size: 177, bin_vheap_size: 0, bin_vheap_block_size: 46422, bin_old_vheap_size: 0, bin_old_vheap_block_size: 46422 ] The fact that the heap_block_size has been increased from 233 to 376 words, and that there's an old_heap that's been allocated and now has data on it, indicates that garbage collection happened, but our tracer process was never sent a message. I tried flushing out the process mailbox for our tracer to see if maybe we were just missing the message, and there was still nothing in there after the function was run. I also tried on a much larger function that generated a lot of data, and I did see plenty of garbage collection messages sent to our tracer in that case, both minor and major GC runs. So, is it possible that the tracer is configured incorrectly? When we set the tracer we're using `:erlang.trace(pid, true, [:garbage_collection, tracer: self()])` (which I think is `erlang:trace(Pid, true, [garbage_collection, {tracer, self()}])` in Erlang syntax if that's more understandable for y'all). This would explain the negative measurements, as there might have been some data on the heap that was collected away, but we were never received any messages about it. Also, this behavior is showing up in both OTP 20 and 21, but it appears to be more pronounced in OTP 21. I hope this helps jog some ideas as to what might be going on here, and thanks again for any help y'all can offer. Cheers, Devon On Sat, Jul 21, 2018 at 12:45 PM Tobias Pfeiffer wrote: > Hi there and thank you for your help! > > I already disassembled it to make sure it's not inlined (I had this with > another benchmark) and it's not: > > {:function, :test, 0, 10, > [ > {:label, 9}, > {:line, [{:location, 'nofile', 2}]}, > {:func_info, {:atom, Test}, {:atom, :test}, 0}, > {:label, 10}, > {:move, {:literal, 1..10}, {:x, 0}}, > {:line, [{:location, 'nofile', 3}]}, > {:call_ext_only, 1, {:extfunc, Enum, :to_list, 1}} > ]}, > > > Disassembled with this code: > https://github.com/PragTob/elixir_playground/blob/master/lib/asm.ex > > I'll try to give some more background information on the problem we have > in the coming days. > > Dank you everyone! > Tobi > > On 07/19/2018 05:28 PM, Jesper Louis Andersen wrote: > > I'm pretty sure that's not it, but a function such as > > > > Enum.to_list(1..10) > > > > contains an enumeration which is a constant and to_list can be unfolded > > to produce [1, ..., 10]. > > > > Since that is a constant it ends up as a literal in the beam bytecode > > and thus it never ever generates any garbage when called. I'm pretty > > sure that Erlang compiler is not smart enough to make this unfolding, > > but it doesn't take a lot of work to make a compiler constant fold such > > a case. Especially if it is common in code since compiler developers > > tend to target that. Another common trick is if escape analysis shows > > the result doesn't outlive its scope in which case data can be > > stack-allocated, making it far more unlikely to produce heap bump > > allocation and thus trigger the GC. > > > > This assumption can be verifed by disassembly of the beam bytecode and > > looking for what the system is doing. > > > > The negative allocation sounds strange to me though. That warrants > > investigation in what the trace calls are returning IMO to verify it > > happens at that level or lower. > > > > On Thu, Jul 19, 2018 at 7:42 AM Devon Estes > > wrote: > > > > Hey everyone, > > > > First off, I would like to apologize for the following code example > > in Elixir - it's the language I know best, and where we're having > > the problem. > > > > Anyway, I'm one of the maintainers of an Elixir benchmarking tool > > called Benchee. A few months ago we added memory measurement as a > > feature in our benchmarking tool. However, with the release of OTP > > 21, we're seeing some measurements that seem very strange. For > > example, according to our measurements, the following function uses > > 0 bytes of memory: `Enum.to_list(1..10)`. On OTP 20, this always > > uses between 350-380 byes depending on the platform. There are a few > > other instances of these kinds of functions which we believe should > > be using memory somewhere, but the results that we get back from our > > measurements say they are not using any memory, and all of them are > > around functions that in OTP 20 used very little memory. We are also > > seeing somewhat frequently what appears to be _negative_ net memory > > usage, which again seems really strange. > > > > So, is this some sort of optimization that we're missing, or is > > there somewhere else (maybe in a heap fragment?) that these > > structures might be stored? And if they are somewhere else, is it > > possible to measure this memory usage? > > > > At the moment we're measuring memory usage by using `erlang:trace/3` > > to listen to the garbage collection events, and calculate the used > > memory from there, and adding any remaining used memory on the heap > > at the end of the function (after the last GC run). > > > > Thanks again for any help y'all might be able to offer! > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > > > > > -- > > J. > > > > > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > > > -- > http://www.pragtob.info/ > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zxq9@REDACTED Sat Jul 28 04:08:17 2018 From: zxq9@REDACTED (zxq9@REDACTED) Date: Sat, 28 Jul 2018 11:08:17 +0900 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: <9e0a38c6-a1fc-e5e3-a8c4-2db9a07e1754@hedeland.org> References: <1566729.RM7CrWi6sU@takoyaki> <9e0a38c6-a1fc-e5e3-a8c4-2db9a07e1754@hedeland.org> Message-ID: <5457405.JspicW6VVV@takoyaki> On 2018?7?27???? 8?37?44? JST Per Hedeland wrote: > On 2018-07-27 01:52, zxq9@REDACTED wrote: > > For whatever reason, Richard's responses never made it into the archive. > > Actually, it seems his messages consistently do not even reach the > *list*, and are seen only when quoted in other messages - is there some > broken filter on the list, or is he intentionally doing > reply-to-sender-only? (Or did he just switch to a mail client that needs > "Reply-To: "? And no, let's not start that discussion again...) > > > I believe they are worthy of preservation. > > +1!:-) I'm not sure. A lot of the messages from him I wind up getting I receive because I'm on the recipient list separately from the ML (maybe from "reply to all"?). erlang-questions is usually just CC'd -- which should work just fine. I can't imagine anyone would filter ROK's messages *out* of the list. Much to the contrary, if I had the time I would put together a compilation of his best posts/threads! So, Richard, if you happen to read this... any idea why your mail isn't hitting the list lately? Maybe one account or another is unsubscribed? -Craig From mononcqc@REDACTED Sat Jul 28 04:29:57 2018 From: mononcqc@REDACTED (Fred Hebert) Date: Fri, 27 Jul 2018 22:29:57 -0400 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: <5457405.JspicW6VVV@takoyaki> References: <1566729.RM7CrWi6sU@takoyaki> <9e0a38c6-a1fc-e5e3-a8c4-2db9a07e1754@hedeland.org> <5457405.JspicW6VVV@takoyaki> Message-ID: <20180728022955.GG1065@ferdmbp.local> On 07/28, zxq9@REDACTED wrote: > >So, Richard, if you happen to read this... any idea why your mail isn't >hitting the list lately? Maybe one account or another is unsubscribed? > A common cause of problems for Mailing lists is the presence or absence of an SPF record for custom domains. I can't see ROK's e-mail address from your reposts, but you can do a quick check by doing a DNS lookup. Here's mine for example: ? dig ferd.ca ANY ... ;; ANSWER SECTION: ferd.ca. 3599 IN A 208.94.116.79 ferd.ca. 3599 IN MX 5 ALT2.ASPMX.L.GOOGLE.COM. ferd.ca. 3599 IN MX 10 ASPMX5.GOOGLEMAIL.COM. ... ferd.ca. 3599 IN TXT "v=spf1 include:_spf.google.com ~all" ferd.ca. 3599 IN SOA ns.phx1.nearlyfreespeech.net. hostmaster.nearlyfreespeech.net. 1406273317 600 180 86400 180 The MX records indicate that I'm redirecting everything on gmail, but the critical one not to be seen as spam or a spoofed e-mail is the TXT record with the SPF entry in it. Background info is at https://support.dnsimple.com/articles/spf-record/ or https://en.wikipedia.org/wiki/Sender_Policy_Framework -- your mail provider should possibly be able to give a line about it so people can configure their stuff themselves. Google's page is at https://support.google.com/a/answer/33786?hl=en if you're using gmail. There's a good chance that something like that could be to blame for missing/non-forwarded e-mails. Regards, Fred. From be.dmitry@REDACTED Sat Jul 28 04:54:12 2018 From: be.dmitry@REDACTED (Dmitry Belyaev) Date: Sat, 28 Jul 2018 12:54:12 +1000 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: <20180728022955.GG1065@ferdmbp.local> References: <1566729.RM7CrWi6sU@takoyaki> <9e0a38c6-a1fc-e5e3-a8c4-2db9a07e1754@hedeland.org> <5457405.JspicW6VVV@takoyaki> <20180728022955.GG1065@ferdmbp.local> Message-ID: <9C87885E-AE02-465C-983C-435B83C147CE@gmail.com> I believe Richard's email was provided in one of the responses: On Mon, Jul 23, 2018 at 10:35 PM, Richard O'Keefe??wrote: ... To me it looks like either mailing list configuration or usage of reply instead of reply all - I often do forget about that in Gmail web UI and even in my mobile email client. On 28 July 2018 12:29:57 GMT+10:00, Fred Hebert wrote: >On 07/28, zxq9@REDACTED wrote: >> >>So, Richard, if you happen to read this... any idea why your mail >isn't >>hitting the list lately? Maybe one account or another is unsubscribed? >> > >A common cause of problems for Mailing lists is the presence or absence > >of an SPF record for custom domains. I can't see ROK's e-mail address >from your reposts, but you can do a quick check by doing a DNS lookup. > >Here's mine for example: > >? dig ferd.ca ANY >... >;; ANSWER SECTION: >ferd.ca. 3599 IN A 208.94.116.79 >ferd.ca. 3599 IN MX 5 >ALT2.ASPMX.L.GOOGLE.COM. >ferd.ca. 3599 IN MX 10 >ASPMX5.GOOGLEMAIL.COM. >... >ferd.ca. 3599 IN TXT "v=spf1 >include:_spf.google.com ~all" >ferd.ca. 3599 IN SOA >ns.phx1.nearlyfreespeech.net. hostmaster.nearlyfreespeech.net. >1406273317 600 180 86400 180 > >The MX records indicate that I'm redirecting everything on gmail, but >the critical one not to be seen as spam or a spoofed e-mail is the TXT >record with the SPF entry in it. > >Background info is at https://support.dnsimple.com/articles/spf-record/ > >or https://en.wikipedia.org/wiki/Sender_Policy_Framework >-- your mail provider should possibly be able to give a line about it >so >people can configure their stuff themselves. Google's page is at >https://support.google.com/a/answer/33786?hl=en if you're using gmail. > >There's a good chance that something like that could be to blame for >missing/non-forwarded e-mails. > >Regards, >Fred. >_______________________________________________ >erlang-questions mailing list >erlang-questions@REDACTED >http://erlang.org/mailman/listinfo/erlang-questions -- Kind regards, Dmitry Belyaev -------------- next part -------------- An HTML attachment was scrubbed... URL: From per@REDACTED Sat Jul 28 13:03:57 2018 From: per@REDACTED (Per Hedeland) Date: Sat, 28 Jul 2018 13:03:57 +0200 Subject: [erlang-questions] Orelse and andalso as short-hand for case In-Reply-To: <9C87885E-AE02-465C-983C-435B83C147CE@gmail.com> References: <1566729.RM7CrWi6sU@takoyaki> <9e0a38c6-a1fc-e5e3-a8c4-2db9a07e1754@hedeland.org> <5457405.JspicW6VVV@takoyaki> <20180728022955.GG1065@ferdmbp.local> <9C87885E-AE02-465C-983C-435B83C147CE@gmail.com> Message-ID: <5287e0e7-cc17-94d6-dbbe-f7884ed122c3@hedeland.org> On 2018-07-28 04:54, Dmitry Belyaev wrote: > I believe Richard's email was provided in one of the responses: > > On Mon, Jul 23, 2018 at 10:35 PM, Richard O'Keefe wrote: > ... > > To me it looks like either mailing list configuration or usage of reply instead of reply all - I often do forget about that in Gmail web UI and even in my mobile email client. Surely you're not suggesting that ROK would ever *forget* anything?:-) But mailing list configuration is likely - AFAIR, this list like most others block messages from non-subscribers to cut down on spam. And the last message directly from Richard that I still have in my inbox happens to be this one: http://erlang.org/pipermail/erlang-questions/2017-November/094170.html Raimo did dutifully reply to that message, but one possibility is that Richard didn't get around to re-subscribing, and get the list messages forwarded from his old address, while his own messages that use the new address are blocked. Raimo, maybe you can have a look? I know that it's outside what can be expected from standard mailing list maintenance, but this concerns a very special subscriber... --Per > On 28 July 2018 12:29:57 GMT+10:00, Fred Hebert wrote: > > On 07/28, zxq9@REDACTED wrote: > > > So, Richard, if you happen to read this... any idea why your mail isn't > hitting the list lately? Maybe one account or another is unsubscribed? > > > > A common cause of problems for Mailing lists is the presence or absence > of an SPF record for custom domains. I can't see ROK's e-mail address > from your reposts, but you can do a quick check by doing a DNS lookup. > Here's mine for example: > > ? dig ferd.ca ANY > ... > ;; ANSWER SECTION: > ferd.ca. 3599 IN A 208.94.116.79 > ferd.ca. 3599 IN MX 5 ALT2.ASPMX.L.GOOGLE.COM. > ferd.ca. 3599 IN MX 10 ASPMX5.GOOGLEMAIL.COM. > ... > ferd.ca. 3599 IN TXT "v=spf1 include:_spf.google.com ~all" > ferd.ca. 3599 IN SOA ns.phx1.nearlyfreespeech.net. hostmaster.nearlyfreespeech.net. 1406273317 600 180 86400 180 > > The MX records indicate that I'm redirecting everything on gmail, but > the critical one not to be seen as spam or a spoofed e-mail is the TXT > record with the SPF entry in it. > > Background info is athttps://support.dnsimple.com/articles/spf-record/ > orhttps://en.wikipedia.org/wiki/Sender_Policy_Framework > -- your mail provider should possibly be able to give a line about it so > people can configure their stuff themselves. Google's page is at > https://support.google.com/a/answer/33786?hl=en if you're using gmail. > > There's a good chance that something like that could be to blame for > missing/non-forwarded e-mails. > > Regards, > Fred. > -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- > > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > > > -- > Kind regards, > Dmitry Belyaev > > > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > From vincefoley@REDACTED Sun Jul 29 22:35:34 2018 From: vincefoley@REDACTED (Vince Foley) Date: Sun, 29 Jul 2018 13:35:34 -0700 Subject: [erlang-questions] Include seq_trace token in logger crash_report? Message-ID: Hello! I'm doing some error monitoring with `logger`, and it'd be really nice to include the `seq_trace` token in the crash_report data structure That'd let me correlate the source of the crash since by the time I get the crash_report message the original process is likely gone.. I see that really useful stuff like the process dictionary & message queue is part of the report, would it be possible to add the token? If so, how would I make such a request? -------------- next part -------------- An HTML attachment was scrubbed... URL: From kuna.prime@REDACTED Sun Jul 29 22:51:26 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Sun, 29 Jul 2018 22:51:26 +0200 Subject: [erlang-questions] priv dir in escript Message-ID: I'm trying to make self contained escript i need priv folder to be included in archive in escript currently i'm extracting files using: 'escript:extract' but in arhive there is no `priv` directory i'm building with rebar3 escriptize any help would be appreciated -------------- next part -------------- An HTML attachment was scrubbed... URL: From t@REDACTED Sun Jul 29 23:04:21 2018 From: t@REDACTED (Tristan Sloughter) Date: Sun, 29 Jul 2018 15:04:21 -0600 Subject: [erlang-questions] priv dir in escript In-Reply-To: References: Message-ID: <1532898261.1964380.1456688168.7E0C2E7A@webmail.messagingengine.com> We definitely need to add this to the docs on rebar3.org, it wasn't documented for historical reasons but it has been stable api for years now. This should work if you replace the app name part with your app's name: {escript_incl_extra, [{"/priv/*, "_build/default/lib/"}]}.It could use improvements to like replace os vars for the profile, but it at least works On Sun, Jul 29, 2018, at 2:51 PM, Karlo Kuna wrote: > I'm trying to make self contained escript > i need priv folder to be included in archive in escript > > currently i'm extracting files using: 'escript:extract' > but in arhive there is no `priv` directory > > i'm building with rebar3 escriptize > > any help would be appreciated > _________________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions -------------- next part -------------- An HTML attachment was scrubbed... URL: From kuna.prime@REDACTED Sun Jul 29 23:47:47 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Sun, 29 Jul 2018 23:47:47 +0200 Subject: [erlang-questions] priv dir in escript In-Reply-To: <1532898261.1964380.1456688168.7E0C2E7A@webmail.messagingengine.com> References: <1532898261.1964380.1456688168.7E0C2E7A@webmail.messagingengine.com> Message-ID: hey Tristan thanks for the reply i have tried your proposal but had no luck i'm running rebar 3.6.1 on Erlang/OTP 21 Erts 10.0 on linux what am i missing? On Sun, Jul 29, 2018 at 11:04 PM Tristan Sloughter wrote: > > We definitely need to add this to the docs on rebar3.org, it wasn't > documented for historical reasons but it has been stable api for years now. > > This should work if you replace the app name part with your app's name: > > {escript_incl_extra, [{"/priv/*, "_build/default/lib/"}]}. > It could use improvements to like replace os vars for the profile, but it > at least works > > On Sun, Jul 29, 2018, at 2:51 PM, Karlo Kuna wrote: > > I'm trying to make self contained escript > i need priv folder to be included in archive in escript > > currently i'm extracting files using: 'escript:extract' > but in arhive there is no `priv` directory > > i'm building with rebar3 escriptize > > any help would be appreciated > *_______________________________________________* > 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 t@REDACTED Sun Jul 29 23:52:44 2018 From: t@REDACTED (Tristan Sloughter) Date: Sun, 29 Jul 2018 15:52:44 -0600 Subject: [erlang-questions] priv dir in escript In-Reply-To: References: <1532898261.1964380.1456688168.7E0C2E7A@webmail.messagingengine.com> Message-ID: <1532901164.1978935.1456720200.31CE333F@webmail.messagingengine.com> Can you share your config or even the whole project? On Sun, Jul 29, 2018, at 3:47 PM, Karlo Kuna wrote: > hey Tristan > > thanks for the reply > i have tried your proposal but had no luck > > i'm running rebar 3.6.1 on Erlang/OTP 21 Erts 10.0 on linux > > what am i missing? > > On Sun, Jul 29, 2018 at 11:04 PM Tristan Sloughter > wrote:>> __ >> >> We definitely need to add this to the docs on rebar3.org, it wasn't >> documented for historical reasons but it has been stable api for >> years now.>> >> This should work if you replace the app name part with your >> app's name:>> >> {escript_incl_extra, [{"/priv/*, >> "_build/default/lib/"}]}.>> It could use improvements to like replace os vars for the profile, >> but it at least works>> >> On Sun, Jul 29, 2018, at 2:51 PM, Karlo Kuna wrote: >>> I'm trying to make self contained escript >>> i need priv folder to be included in archive in escript >>> >>> currently i'm extracting files using: 'escript:extract' >>> but in arhive there is no `priv` directory >>> >>> i'm building with rebar3 escriptize >>> >>> any help would be appreciated >>> _________________________________________________ >>> 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 velichkin@REDACTED Sun Jul 29 21:35:21 2018 From: velichkin@REDACTED (Roman Velichkin) Date: Sun, 29 Jul 2018 22:35:21 +0300 Subject: [erlang-questions] Erlang Job Opportunity Message-ID: Hi guys, We are continuing to expand our engineering department and trying?to build erlang team in Czech Republic (Brno) or Slovakia (Bratislava). As a member of a global development team, you will contribute to design, development, testing and operational maintenance (DevOps model) of the software components owned by the team. You will own services which solve sophisticated problems related to big data storage, search and data lifecycle management using native cloud architectures. You will also be exposed to many challenges in designing highly scalable and available distributed data processing system. Our continuous integration and deployment pipeline technology will allow you to focus on things that matter. In collaboration with other development teams you will ultimately deliver complex solutions for our security as a service platform to thousands of customers all around the world. Please, find more detailes here:?https://nabidka-prace.monster.cz/Senior-Engeneer-Erlang-SE-Reksoft-AB/11/198266995 In case you are interested in it, please submit position on Monster or send you CV to velichkin@REDACTED Best Regards, Roman Velichkin -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Image.681924559966.png Type: image/png Size: 1690 bytes Desc: not available URL: From kuna.prime@REDACTED Mon Jul 30 00:10:17 2018 From: kuna.prime@REDACTED (Karlo Kuna) Date: Mon, 30 Jul 2018 00:10:17 +0200 Subject: [erlang-questions] priv dir in escript In-Reply-To: <1532898261.1964380.1456688168.7E0C2E7A@webmail.messagingengine.com> References: <1532898261.1964380.1456688168.7E0C2E7A@webmail.messagingengine.com> Message-ID: OK, i have got it to work having followed Tristan's advice and also looking at rebar3 source code this is my conclusion: {escript_incl_extra, [{"", "_build/default/lib/"}]}. escript_incl_extra is using wildcard_pattern to search for files so if you want all nested files one would write: "my_app/priv/**". In the result empty folders are omitted (shame)! On Sun, Jul 29, 2018 at 11:04 PM Tristan Sloughter wrote: > > We definitely need to add this to the docs on rebar3.org, it wasn't > documented for historical reasons but it has been stable api for years now. > > This should work if you replace the app name part with your app's name: > > {escript_incl_extra, [{"/priv/*, "_build/default/lib/"}]}. > It could use improvements to like replace os vars for the profile, but it > at least works > > On Sun, Jul 29, 2018, at 2:51 PM, Karlo Kuna wrote: > > I'm trying to make self contained escript > i need priv folder to be included in archive in escript > > currently i'm extracting files using: 'escript:extract' > but in arhive there is no `priv` directory > > i'm building with rebar3 escriptize > > any help would be appreciated > *_______________________________________________* > 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 empro2@REDACTED Mon Jul 30 10:33:04 2018 From: empro2@REDACTED (empro2@REDACTED) Date: Mon, 30 Jul 2018 10:33:04 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180726131147.GA94922@erix.ericsson.se> References: <20180724110243.11f236ce@raspy> <20180726131147.GA94922@erix.ericsson.se> Message-ID: <20180730103304.25ea8f8a@raspy> Am Thu, 26 Jul 2018 15:11:47 +0200 schrieb Raimo Niskanen : > Please have a look at and evaluate GitHub PR#1891: > > https://github.com/erlang/otp/pull/1891 Thank you for the effort. I have checked the changes and also have (to my surprise) not found any useful "can not". IMHO the result is much clearer, but I would never insist on this "unconvenient broadside to the repository" be forced on someone. Michael -- Parens should have fewer children and more t. From empro2@REDACTED Mon Jul 30 10:49:14 2018 From: empro2@REDACTED (empro2@REDACTED) Date: Mon, 30 Jul 2018 10:49:14 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180727075225.GA78257@erix.ericsson.se> References: <20180724110243.11f236ce@raspy> <20180726131147.GA94922@erix.ericsson.se> <20180727075225.GA78257@erix.ericsson.se> Message-ID: <20180730104914.417563e4@raspy> I would like to apologise: * if my original post was not perceived to be humourously rhetorical; my English is much worse than it might look. * for too many too detailed replies. I was switched into argumentation (not argument!) mode by the unfortunate coincidence of an overdose of surprise, the confusing nature of language matters (negation especially), two years of "what? ah, mere typo" and too hot weather. It might also have to do with the then waxing blood moon. (I wonder why there is dog hair all over my place now ... ;-) Glad that two people have used the word "fun" in this thread Michael -- "Oh no! It should be poetry not prose" ? Pet Shop Boys. _It must be obvious_ From raimo+erlang-questions@REDACTED Mon Jul 30 10:56:15 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Mon, 30 Jul 2018 10:56:15 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180730103304.25ea8f8a@raspy> References: <20180724110243.11f236ce@raspy> <20180726131147.GA94922@erix.ericsson.se> <20180730103304.25ea8f8a@raspy> Message-ID: <20180730085615.GA89447@erix.ericsson.se> On Mon, Jul 30, 2018 at 10:33:04AM +0200, empro2@REDACTED wrote: > Am Thu, 26 Jul 2018 15:11:47 +0200 > schrieb Raimo Niskanen > : > > > Please have a look at and evaluate GitHub PR#1891: > > > > https://github.com/erlang/otp/pull/1891 > > Thank you for the effort. > > I have checked the changes and also have (to my > surprise) not found any useful "can not". Thank you for the review! > > IMHO the result is much clearer, but I would never insist on > this "unconvenient broadside to the repository" be forced on > someone. I think now is a better time than most, thanks to being vacation time... > > Michael > > -- > > Parens should have fewer children and more t. > -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From raimo+erlang-questions@REDACTED Mon Jul 30 11:02:00 2018 From: raimo+erlang-questions@REDACTED (Raimo Niskanen) Date: Mon, 30 Jul 2018 11:02:00 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180730104914.417563e4@raspy> References: <20180724110243.11f236ce@raspy> <20180726131147.GA94922@erix.ericsson.se> <20180727075225.GA78257@erix.ericsson.se> <20180730104914.417563e4@raspy> Message-ID: <20180730090200.GB89447@erix.ericsson.se> On Mon, Jul 30, 2018 at 10:49:14AM +0200, empro2@REDACTED wrote: > I would like to apologise: > > * if my original post was not perceived to be humourously > rhetorical; my English is much worse than it might look. > > * for too many too detailed replies. I was switched into > argumentation (not argument!) mode by the unfortunate > coincidence of an overdose of surprise, the confusing > nature of language matters (negation especially), two > years of "what? ah, mere typo" and too hot weather. > It might also have to do with the then waxing blood moon. > (I wonder why there is dog hair all over my place > now ... ;-) > > Glad that two people have used the word "fun" in this thread :-) I would also like to apologise that it took so many mails before I got a grip on the actual problem!.. As I recently tried to motivate - splitting vs. concatenating words is one aspect of English I think we Swedes has got special problems with, because of related problems in Swedish... > > Michael > > -- > > "Oh no! It should be poetry not prose" > > ? Pet Shop Boys. _It must be obvious_ -- / Raimo Niskanen, Erlang/OTP, Ericsson AB From lukas@REDACTED Mon Jul 30 11:05:00 2018 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 30 Jul 2018 11:05:00 +0200 Subject: [erlang-questions] Include seq_trace token in logger crash_report? In-Reply-To: References: Message-ID: Hello! On Sun, Jul 29, 2018 at 10:35 PM Vince Foley wrote: > Hello! I'm doing some error monitoring with `logger`, and it'd be really > nice to include the `seq_trace` token in the crash_report data structure > > That'd let me correlate the source of the crash since by the time I get > the crash_report message the original process is likely gone.. > > I see that really useful stuff like the process dictionary & message queue > is part of the report, would it be possible to add the token? If so, how > would I make such a request? > You can add your own report-data to the log report by using a logger filter. For instance the filter below will include the seq_trace token into any logging message that fits the structure of an otp error report. SeqTraceFilter = fun(#{msg := {report, #{ report := R } = Msg}} = L,_) -> L#{ msg := {report, Msg#{ report := [{seq_trace,seq_trace:get_token()} | R] }}}; (L,_) -> L end, logger:add_primary_filter(seq_trace,{SeqTraceFilter,[]}). Another way to achieve the same thing would be to add the seq_trace token as a meta entry using a filter and then output that by modifying the template of the default handler. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Mon Jul 30 17:08:39 2018 From: lukas@REDACTED (Lukas Larsson) Date: Mon, 30 Jul 2018 17:08:39 +0200 Subject: [erlang-questions] UDP receive performance In-Reply-To: References: <20180524072357.GA97377@erix.ericsson.se> <355E67A6-9883-451D-A31D-8CC710244719@gmail.com> <19DDAEE8-037B-4793-9C83-7D8D5C73C234@mobilearts.com> <0AE32206-3A53-404A-A97E-426E0E974FA1@mobilearts.com> Message-ID: On Tue, Jul 17, 2018 at 11:10 AM Max Lapshin wrote: > Will try to check it, because right now we are running separate thread > with libevent for capturing udp =( > I suppose you didn't find time to test it yet? If you need any further help or find that it still isn't fast enough for you, I would be very interested in trying to make it fast enough. I stumbled upon the recvmmsg syscall today, which could replace the read_packets option and significantly decrease the number of roundtrips into the kernel that you have to make. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From vincefoley@REDACTED Tue Jul 31 07:50:21 2018 From: vincefoley@REDACTED (Vince Foley) Date: Mon, 30 Jul 2018 22:50:21 -0700 Subject: [erlang-questions] Include seq_trace token in logger crash_report? In-Reply-To: References: Message-ID: wow, that's awesome. I tried it out and that indeed will work for me! Thanks! On Mon, Jul 30, 2018 at 2:05 AM, Lukas Larsson wrote: > Hello! > > On Sun, Jul 29, 2018 at 10:35 PM Vince Foley wrote: > >> Hello! I'm doing some error monitoring with `logger`, and it'd be really >> nice to include the `seq_trace` token in the crash_report data structure >> > >> That'd let me correlate the source of the crash since by the time I get >> the crash_report message the original process is likely gone.. >> >> I see that really useful stuff like the process dictionary & message >> queue is part of the report, would it be possible to add the token? If so, >> how would I make such a request? >> > > You can add your own report-data to the log report by using a logger > filter. For instance the filter below will include the seq_trace token into > any logging message that fits the structure of an otp error report. > > SeqTraceFilter = fun(#{msg := {report, #{ report := R } = Msg}} = L,_) -> > L#{ msg := {report, Msg#{ report := > [{seq_trace,seq_trace:get_token()} | R] }}}; > (L,_) -> L > end, > logger:add_primary_filter(seq_trace,{SeqTraceFilter,[]}). > > Another way to achieve the same thing would be to add the seq_trace token > as a meta entry using a filter and then output that by modifying the > template of the default handler. > > Lukas > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raoknz@REDACTED Tue Jul 31 08:18:48 2018 From: raoknz@REDACTED (Richard O'Keefe) Date: Tue, 31 Jul 2018 18:18:48 +1200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180727075225.GA78257@erix.ericsson.se> References: <20180724110243.11f236ce@raspy> <20180726131147.GA94922@erix.ericsson.se> <20180727075225.GA78257@erix.ericsson.se> Message-ID: The normal English word is "can't". In primary school I was taught not to use such informal stuff in writing but to always use "cannot" expect in reported speech. It is certainly a word. Collins say it is one of the top 1000 words. https://www.collinsdictionary.com/dictionary/english/cannot "can not" is occasionally ambiguous (less so in speech, where "CAN not" = "cannot" = "can't", "can NOT" is the other reading). To be honest, "can not" grates on this native speaker of English. It's on a par with "precise" used as a verb. Stick with "cannot". If you have a copy of the 'style' and 'diction' programs, you probably want to add "can not" to the diction list of things not to write. On 27 July 2018 at 19:52, Raimo Niskanen < raimo+erlang-questions@REDACTED> wrote: > On Thu, Jul 26, 2018 at 03:11:47PM +0200, Raimo Niskanen wrote: > > Please have a look at and evaluate GitHub PR#1891: > > > > https://github.com/erlang/otp/pull/1891 > > Fun story: A coworker just vaguely remembered that the technical writer(s) > we had working on the documentation in late 2016 maybe made this kind of > changes, and surely enough they did change "can not" into "cannot". > > This did not stick in all developers' memory, though, since at least 6 of > us has re-introduced "can not"s after that. > > It is actually a hard one, I think especially for Swedes, since we have an > ongoing language war/debate about people splitting Swedish words that > should be concatenated due to influence from English so the safe bet for a > Swede is that in proper English it is probably not one word. > > I asked around me and the most common reaction is: "cannot" - is that even > a proper word? I would have written "can not"! > > And this is from people born in the 60:s through the 90:s, at least. > > So it will take a while for this detail to become common truth, at > least in Sweden... > > We will work on it, but it will take time. > > Best Regards > / Raimo > > > > > > > > On Tue, Jul 24, 2018 at 11:02:43AM +0200, empro2@REDACTED wrote: > > > This is only the most recent occurrence that finally > > > makes me write this: > > > > > > > > > [erlang-questions] Patch package OTP 20.3.8.3 released > > > Tue, 24 Jul 2018 09:13:22 +0200 > > > [...] > > > Note! The kernel-5.4.3.2 application can *not* be applied > > > independently of other applications on an arbitrary > > > OTP 20 installation. > > > [...] > > > > > > > > > If it can not be applied independently then it can also be > > > applied independently - which, in this case, is > > > probably not what is meant. But this is guesswork, relying > > > on the reader already knowing the meaning of what is > > > being said, rendering the saying it much less useful. > > > > > > Modals are a mess (spoken languages are, after ceturies of > > > abuse like the one discussed in "[erlang-questions] Orelse > > > and andalso as short-hand for case"), but they convey > > > critical meaning. > > > > > > Nine(?) of ten "can not"s in the Erlang docs must be > > > "cannot" to convey the correct meaning. Reading the docs has > > > already made me convert every "can not" I read into > > > "cannot" - I mean *every*, not only those in the Erlang > > > docs - and then back again (only about 1 of 10 in the > > > Erlang docs). This is a real, and substantial, waste of > > > post-orbital CPU cycles; not the conversion itself, but the > > > distraction from understanding whatever meaning the author > > > actually tries to get across. > > > > > > If someone with authority (and authorisation) could and > > > would please write and run a script and convert all "can > > > not" -> "cannot" in all OTP strings, binaries and comments? > > > This will introduce errors, as there actually are a few, > > > rare correct "can not"s, but it will correct about 9 times > > > more of wrong ones that really need to be "cannot". > > > > > > At least in the doc strings? > > > > > > Please? > > > > > > Michael > > > > > > -- > > > > > > Time is not money, but money is time: life-time people have > > > spent transforming their environment. > > > > > > > > > > -- > > > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > > _______________________________________________ > > erlang-questions mailing list > > erlang-questions@REDACTED > > http://erlang.org/mailman/listinfo/erlang-questions > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From raoknz@REDACTED Tue Jul 31 08:36:31 2018 From: raoknz@REDACTED (Richard O'Keefe) Date: Tue, 31 Jul 2018 18:36:31 +1200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180730090200.GB89447@erix.ericsson.se> References: <20180724110243.11f236ce@raspy> <20180726131147.GA94922@erix.ericsson.se> <20180727075225.GA78257@erix.ericsson.se> <20180730104914.417563e4@raspy> <20180730090200.GB89447@erix.ericsson.se> Message-ID: One common source of confusion is phrasal verbs. (I am quite upset that my now-legally-adult daughters were never introduced to the term "phrasal verb" at school; it's as if someone in the Ministry of Education interpreted the title in an Orwellian way.) "Look up the name in a table." (Verb and particle are two words.) "Look the name up in a table." (Two words, same meaning.) "Seek the name in a lookup table." (One word.) "How many lookups did that need?" (One word.) The rule is: verb => 2 words, noun or adjective => 1 word. I've always wondered about the connection between English phrasal verbs and German verbs with separable prefixes; so many of the latter have English translations that are phrasal verbs with the corresponding preposition as particle. On 30 July 2018 at 21:02, Raimo Niskanen < raimo+erlang-questions@REDACTED> wrote: > On Mon, Jul 30, 2018 at 10:49:14AM +0200, empro2@REDACTED wrote: > > I would like to apologise: > > > > * if my original post was not perceived to be humourously > > rhetorical; my English is much worse than it might look. > > > > * for too many too detailed replies. I was switched into > > argumentation (not argument!) mode by the unfortunate > > coincidence of an overdose of surprise, the confusing > > nature of language matters (negation especially), two > > years of "what? ah, mere typo" and too hot weather. > > It might also have to do with the then waxing blood moon. > > (I wonder why there is dog hair all over my place > > now ... ;-) > > > > Glad that two people have used the word "fun" in this thread > > :-) > > I would also like to apologise that it took so many mails before I got a > grip on the actual problem!.. > > As I recently tried to motivate - splitting vs. concatenating words is one > aspect of English I think we Swedes has got special problems with, because > of related problems in Swedish... > > > > > Michael > > > > -- > > > > "Oh no! It should be poetry not prose" > > > > ? Pet Shop Boys. _It must be obvious_ > > -- > > / Raimo Niskanen, Erlang/OTP, Ericsson AB > _______________________________________________ > erlang-questions mailing list > erlang-questions@REDACTED > http://erlang.org/mailman/listinfo/erlang-questions > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lukas@REDACTED Tue Jul 31 09:39:36 2018 From: lukas@REDACTED (Lukas Larsson) Date: Tue, 31 Jul 2018 09:39:36 +0200 Subject: [erlang-questions] Memory usage in OTP 21 In-Reply-To: References: <953b1a28-e8e4-706f-8af7-412efc4320f0@gmail.com> Message-ID: Hello, On Fri, Jul 27, 2018 at 10:11 PM Devon Estes wrote: > I hope this helps jog some ideas as to what might be going on here, and > thanks again for any help y'all can offer. > I think I have figured out what is going on. It seems to be the allocation of the term containing the garbage_collection_info that is messing with measurements. I'll try to change the code inside process_info to give a more accurate view of the current memory usage, however as long as the call to process_info happens in the process doing the call there will be some miss match. I would suggest that you instead do a call to erlang:garbage_collect() before and after the benchmark is run and rely on tracing to get the correct information. Alternatively you could call erlang:process_info on the process from the trace collector, though then you would need some type of synchronization in between the processes. I have not been able to reproduce the scenario you mentioned where the heap_block_size is increased without getting a trace message. What code did you run to trigger that? As always an Erlang example would be preferable, but I should manage with an Elixir one as well. Lukas -------------- next part -------------- An HTML attachment was scrubbed... URL: From devon.c.estes@REDACTED Tue Jul 31 20:08:52 2018 From: devon.c.estes@REDACTED (Devon Estes) Date: Tue, 31 Jul 2018 20:08:52 +0200 Subject: [erlang-questions] Memory usage in OTP 21 In-Reply-To: References: <953b1a28-e8e4-706f-8af7-412efc4320f0@gmail.com> Message-ID: Thanks so much for this! That's probably a good idea calling `erlang:garbage_collect()` and relying on the trace information. I'll play around with that to see how that affects things. I'm seeing the behavior with the heap_block_size on this branch: https://github.com/PragTob/benchee/tree/memory-measurement-issues We have some samples in there, usually to show how to use benchee, but I've added one to reproduce this issue (in `samples/wtf.exs`). If you run `mix run samples/wtf.exs`, you'll see the process_info data printed to the console, both before and after the function to be measured is run, and you won't see any indication that a garbage collection event happened. If you bump up the size of the range in the sample `samples/wtf.exs` to `1..5000`, you'll see that 9 GC runs take place (7 minor, 2 major). Also, if it helps, the code around memory measurement is all in `lib/benchee/benchmark/measure/memory.ex`. I'll try tomorrow to write this up in Erlang to reproduce it that way as well. On Tue, Jul 31, 2018 at 9:39 AM Lukas Larsson wrote: > Hello, > > On Fri, Jul 27, 2018 at 10:11 PM Devon Estes > wrote: > >> I hope this helps jog some ideas as to what might be going on here, and >> thanks again for any help y'all can offer. >> > > I think I have figured out what is going on. It seems to be the allocation > of the term containing the garbage_collection_info that is messing with > measurements. I'll try to change the code inside process_info to give a > more accurate view of the current memory usage, however as long as the call > to process_info happens in the process doing the call there will be some > miss match. > > I would suggest that you instead do a call to erlang:garbage_collect() > before and after the benchmark is run and rely on tracing to get the > correct information. Alternatively you could call erlang:process_info on > the process from the trace collector, though then you would need some type > of synchronization in between the processes. > > I have not been able to reproduce the scenario you mentioned where the > heap_block_size is increased without getting a trace message. What code did > you run to trigger that? As always an Erlang example would be preferable, > but I should manage with an Elixir one as well. > > Lukas > -------------- next part -------------- An HTML attachment was scrubbed... URL: From empro2@REDACTED Tue Jul 31 20:22:16 2018 From: empro2@REDACTED (empro2@REDACTED) Date: Tue, 31 Jul 2018 20:22:16 +0200 Subject: [erlang-questions] 'cannot' /= 'can not' In-Reply-To: <20180730085615.GA89447@erix.ericsson.se> References: <20180724110243.11f236ce@raspy> <20180726131147.GA94922@erix.ericsson.se> <20180730103304.25ea8f8a@raspy> <20180730085615.GA89447@erix.ericsson.se> Message-ID: <20180731202216.3796b55d@raspy> Am Mon, 30 Jul 2018 10:56:15 +0200 schrieb Raimo Niskanen : > Thank you for the review! Not at all! least I could do having brought this up. > I think now is a better time than most, thanks to being > vacation time... I wonder what to do with the notes I took while at it. - EEP: overkill, completely wrong place. - erlang-patches? The things there do look different. - bugs.erlang.org: as an improvement? and then each one separately? there is nothing like it (yet)(?) I noted down 4 and a half cases in which the change itself seems to be of little use. As I could not make much sense of the text in these cases (using only the extended diff contexts) my "suggestions" are no more than possibly helpful phrasings. The notes are down below my name, introduced by ===, [comments in square brackets]. I have no experience with projects of that size and no idea about the hassle : gain ratio. Michael === erts/emulator/beam/erl_db_tree.c 3129 https://github.com/erlang/otp/pull/1891/files#diff-30fdd1356f85b600e88e98de46e5a338 + erts_fprintf(stderr," cannot match lesser than "); less than [This is the half one: not misleading, but seems so basic a message that it might be desirable to have "correct".] === erts/doc/src/notes.xml 9902 https://github.com/erlang/otp/pull/1891/files#diff-eb82a09c6aefc9ef174ead9c8181a141 and there === lib/stdlib/doc/src/notes.xml 3657 https://github.com/erlang/otp/pull/1891/files#diff-4e42fb7d23d206e8b0fcbfd4858b1672

To roughly the old behaviour, to not wait for ports and async threads operations when you exit the emulator, you use erlang:halt/2 with an integer first argument and an option list containing {flush,false} as the second argument. Note that now is flushing not dependant of the - exit code, and you can not only flush async threads + exit code, and you cannot only flush async threads operations which we deemed as a strange behaviour anyway.

To roughly approximate the old behaviour,[?] which was to not wait ... when you exit the emulator,[?] use erlang:halt/2 [without the "you"?] Note that flushing does not depend on the exit code anymore [??] and you are no longer restricted to flushing async threads operations only[?] , a restriction we deemed strange anyway.[?, useful? replace with:] ; now you can flush sync ones too.[?] === lib/observer/src/observer_wx.erl 809 https://github.com/erlang/otp/pull/1891/files#diff-ebe399fc76aff158ba9cb898ccfba2d2 %% If already started, somebody else may use it. + %% We cannot use it too, as far log file would be overriden. Not fair. somebody else may be using it.[But is this about using it at all? or about preventing the start of a second one?] We must not start a second one[?], as that would overwrite the remote log file.[?] === lib/odbc/doc/src/notes_history.xml 196 https://github.com/erlang/otp/pull/1891/files#diff-c673d56ed2511271ba68533de94c9b13 + connection cannot be established. No connection no process it is expected. No connection, no process; just as one would expect.[??] -- Reasonable is that which cannot be criticised reasonably.