profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/AndrewDryga/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Andrew Dryga AndrewDryga Nebo #15 Kiev, Ukraine http://dryga.com CTO/Full-Stack Developer in Fintech and Blockchain domains. Elixir, DevOps, PHP, JavaScript and much more.

AndrewDryga/jQuery.DebouncedResize 5

Debounced Resize Event for jQuery with Bower support

AndrewDryga/grunt-bower-installer 2

Grunt plugin for Bower

AndrewDryga/antidote 1

A work-in-progress blazing fast Elixir json library

AndrewDryga/elixir-companies 1

A list of companies currently using Elixir in production.

AndrewDryga/font-rexbold 1

Rex Bold font repo for using with Bower. Font taken from fonts2u.com.

AndrewDryga/absinthe_plug 0

Plug support for Absinthe, the GraphQL toolkit for Elixir

AndrewDryga/api-spec 0

API Specififications

AndrewDryga/authable 0

OAuth2 Provider implementation modules and helpers using plug, ecto and postgress for any elixir application.

AndrewDryga/awesome-elixir 0

A curated list of amazingly awesome Elixir and Erlang libraries, resources and shiny things. Updates:

delete branch elixir-ecto/db_connection

delete branch : josevalim-patch-1

delete time in 3 hours

pull request commentelixir-ecto/db_connection

Update spec

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:

josevalim

comment created time in 3 hours

push eventelixir-ecto/db_connection

José Valim

commit sha 6850853977a08ca9bbc7fc5d9d2b07f028720a6c

Update spec (#242) Closes #241

view details

push time in 3 hours

PR merged elixir-ecto/db_connection

Update spec

Closes #241

+4 -2

0 comment

1 changed file

josevalim

pr closed time in 3 hours

issue closedelixir-ecto/db_connection

Typespec Inconsistency

The return value here is a 5 element tuple, rather than the 4 element tuple declared in the typespec:

The typespec:

https://github.com/elixir-ecto/db_connection/blob/4d7e789943f1c3a0b54b871f3807a04303e666dc/lib/db_connection/holder.ex#L50

The offenders:

https://github.com/elixir-ecto/db_connection/blob/4d7e789943f1c3a0b54b871f3807a04303e666dc/lib/db_connection/holder.ex#L57

https://github.com/elixir-ecto/db_connection/blob/4d7e789943f1c3a0b54b871f3807a04303e666dc/lib/db_connection/holder.ex#L77

closed time in 3 hours

isaacsanders

PR opened elixir-ecto/db_connection

Update spec

Closes #241

+4 -2

0 comment

1 changed file

pr created time in 3 hours

create barnchelixir-ecto/db_connection

branch : josevalim-patch-1

created branch time in 3 hours

issue openedelixir-ecto/db_connection

Typespec Inconsistency

The return value here is a 5 element tuple, rather than the 4 element tuple declared in the typespec:

https://github.com/elixir-ecto/db_connection/blob/master/lib/db_connection/holder.ex#L57

created time in 3 hours

issue commenterlang/otp

Cannot reallocate 0 bytes of memory (of type "estack")

You can send the crash dump to rickard at erlang.org

lhoguin

comment created time in 4 hours

issue commenterlang/otp

OTP 23 beam can‘t auto gc on a CentOS 7 server

This is not a bug. A process is not garbage collected unless it reach certain limits, for example it needs to allocate heap data and there is no free heap available. If a process stops executing, it does not matter how long time passes, it wont automatically garbage collect by itself unless it reaches one of these limits.

TangYunTao

comment created time in 4 hours

issue closederlang/otp

OTP 23 beam can‘t auto gc on a CentOS 7 server

Describe the bug OTP 23 beam can‘t auto gc on a CentOS 7 server,and call 'erlang:garbage_collect' effectively frees the process's memory; and It works on mac

To Reproduce Steps to reproduce the behavior.

Expected behavior after the client establishes a connection to the server, the process takes 40K bytes and does not release it

Affected versions otp 23

Additional context gc.md

closed time in 4 hours

TangYunTao

issue commenterlang/otp

ssl psk ciphers options break between ssl 9.2 and 10.1

There seems to be a larger problem with option handling. After changing the options to look like this:

    SslOptions = [
                  { verify, verify_none },
                  { psk_identity, "TESTID" },
                  { versions, [ 'tlsv1.2' ] },
                  { user_lookup_fun, { fun psk_lookup/3, nil } },
                  { ciphers, [
                              #{
                                cipher => aes_128_cbc,
                                key_exchange => psk,
                                mac => sha,
                                prf => default_prf
                               }
                             ]
                  }
                 ],

I run the same test using a docker container based on alpine, which does not include and ca-certificates by default and the error produced was:

=WARNING REPORT==== 18-Jun-2021::19:32:38.925569 ===
Description: "Authenticity is not established by certificate path validation"
     Reason: "Option {verify, verify_peer} and cacertfile/cacerts is missing"

But {verify, verify_none} is set. Using versions [ 'tlsv1.2' ] did not alter the outcome.

danj3

comment created time in 4 hours

pull request commenterlang/otp

doc: Fix spelling errors

@lagebr you need to do a rebase --onto and force push your branch, moving things backwards with github button does not work I am afraid.

lagebr

comment created time in 4 hours

issue openederlang/otp

lists:search/2 documentation and implementation disagree about non-true return values of Pred function

Describe the bug

The man page for lists (lib/stdlib/doc/src/lists.xml) describes the lists:search/2 function as

  • search(Pred, List) -> {value, Value} | false If there is a Value in List such that Pred(Value) returns true, returns {value, Value} for the first such Value, otherwise returns false.

This makes no mention whatsoever about what the Pred(Value) call needs to return if it does not return true, so all values which are not the atom true should be valid according to that description.

However, the implementation of lists:search/2 in lib/stdlib/src/lists.erl is more strict and insists that Pred(Value) MUST return either the atom true or the atom false, which is also reflected by its -spec specifying a boolean() return value.

-spec search(Pred, List) -> {value, Value} | false when
      Pred :: fun((T) -> boolean()),
      List :: [T],
      Value :: T.

search(Pred, [Hd|Tail]) ->
    case Pred(Hd) of
        true -> {value, Hd};
        false -> search(Pred, Tail)
    end;
search(Pred, []) when is_function(Pred, 1) ->
    false.

To Reproduce

Run this script:

#!/usr/bin/env escript
%% -*- erlang -*-

main([]) ->
    lists:search(fun(X) ->
			 case X rem 2 of
			     0 -> true;
			     _ -> odd
			 end
		 end,
		 [5,1,3,2,9,14]),
    ok.
[user@host ~]$ escript lists-search-pred-values
escript: exception error: no case clause matching odd
  in function  lists:search/2 (lists.erl, line 1412)
  in call from erl_eval:do_apply/6 (erl_eval.erl, line 680)
  in call from escript:eval_exprs/5 (escript.erl, line 872)
  in call from erl_eval:local_func/6 (erl_eval.erl, line 567)
  in call from escript:interpret/4 (escript.erl, line 788)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_em/1 
  in call from init:do_boot/3 
[user@host ~]$ 

Yes, this example fun may look a bit contrived, but with a number of OTP functions such as lists:search/2 or lists:keysearch/3 returning either {value, Value} or false, there are certainly precedents for a function returning either a boolean value or something that is not a boolean value at all not being very unusual.

Expected behavior

If the documentation is correct, the escript should run without throwing an exception.

Affected versions

All OTP versions since the introduction of lists:search/2 which, according to lists.xml, was OTP 21.0. In my case, OTP 23.

Additional context

I see two ways to fix this:

  • either fix the documentation to explicitly demand that Pred(Value) needs to return either true or false
  • or fix the implementation (and the -spec) to allow for any non-true value to be interpreted as currently false is

There are arguments for both ways. Fixing the implementation appears to allow all non-true values appears to be the more Erlang-y way to me, though, and should change much in the code (not sure whether the -spec for Pred is a good way to express this, though):

-spec search(Pred, List) -> {value, Value} | false when
      Pred :: fun((T) -> true | term()),
      List :: [T],
      Value :: T.

search(Pred, [Hd|Tail]) ->
    case Pred(Hd) of
        true -> {value, Hd};
        _ -> search(Pred, Tail)
    end;
search(Pred, []) when is_function(Pred, 1) ->
    false.

created time in 6 hours

Pull request review commenterlang/otp

Clean up and support reuse of distribution capability bits

 -define(DFLAG_EXIT_PAYLOAD, 16#400000). -define(DFLAG_FRAGMENTS,    16#00800000). -define(DFLAG_HANDSHAKE_23, 16#01000000).--define(DFLAG_RESERVED,     16#fe000000).--define(DFLAG_SPAWN,       16#100000000).--define(DFLAG_NAME_ME,     16#200000000).--define(DFLAG_V4_NC,       16#400000000).--define(DFLAG_ALIAS,       16#800000000).+-define(DFLAG_MANDATORY_25, 16#04000000).
-define(DFLAG_UNLINK_ID, 16#02000000).
-define(DFLAG_MANDATORY_25, 16#04000000).

I seem to have forgotten the DFLAG_UNLINK_ID flag here...

bjorng

comment created time in 7 hours

Pull request review commenterlang/otp

Clean up and support reuse of distribution capability bits

 -define(ERL_DIST_VER_LOW, ?ERL_DIST_VER_5). -define(ERL_DIST_VER_HIGH, ?ERL_DIST_VER_6). +%%%+%%% To avoid having to extend the number of distribution flags from 64+%%% to 128, an scheme for garbage collection of the flags was
%%% to 128, a scheme for garbage collection of the flags was
bjorng

comment created time in 7 hours

Pull request review commenterlang/otp

Clean up and support reuse of distribution capability bits

 #define DFLAG_DIST_STRICT_ORDER DFLAG_DIST_HDR_ATOM_CACHE  /* All flags that should be enabled when term_to_binary/1 is used. */-#define TERM_TO_BINARY_DFLAGS (DFLAG_EXTENDED_REFERENCES	\-			       | DFLAG_NEW_FUN_TAGS		\-			       | DFLAG_NEW_FLOATS		\-			       | DFLAG_EXTENDED_PIDS_PORTS	\-			       | DFLAG_EXPORT_PTR_TAG		\-			       | DFLAG_BIT_BINARIES             \-			       | DFLAG_MAP_TAG                  \-                               | DFLAG_BIG_CREATION)+#define TERM_TO_BINARY_DFLAGS DFLAG_NEW_FLOATS
#define TERM_TO_BINARY_DFLAGS 0

Since DFLAG_NEW_FLOATS now are mandatory, or maybe I'm missing something?

bjorng

comment created time in 7 hours

Pull request review commenterlang/otp

Clean up and support reuse of distribution capability bits

 dflag2str(?DFLAG_FRAGMENTS) ->     "FRAGMENTS"; dflag2str(?DFLAG_HANDSHAKE_23) ->     "HANDSHAKE_23";
    "HANDSHAKE_23";
dflag2str(?DFLAG_UNLINK_ID) ->
    "UNLINK_ID";

I seem to have forgotten the DFLAG_UNLINK_ID flag here...

bjorng

comment created time in 7 hours

push eventerlang/otp

Micael Karlberg

commit sha 269a7d1961b3e61237afc4378b2046c298b2c76f

[kernel] Improve inet:info/1 The info function did not handle a closed socket well. A 'closed' socket is represented by a info map with *only* the one or two states-attributes, with the value(s) set to [closed]. Also if the function is called for a non-socket port, behave as well as possible (no status or statistics). OTP-17492 [kernel] More tweaking

view details

Micael Karlberg

commit sha c6d8967198e3e4515ed81cc3908821b92d658042

[kernel|test] Add (simple) test cases Add two simple test cases to is a very simple way verify that inet:info/1 behaves "properly". OTP-17492

view details

Micael Karlberg

commit sha 0aeeaeb95d12c0edcf50943a55e1dee3fbe16328

Merge branch 'bmk/kernel/20210614/inet_info_closed_socket/OTP-17492' into maint OTP-17492

view details

push time in 7 hours

push eventerlang/otp

Micael Karlberg

commit sha 269a7d1961b3e61237afc4378b2046c298b2c76f

[kernel] Improve inet:info/1 The info function did not handle a closed socket well. A 'closed' socket is represented by a info map with *only* the one or two states-attributes, with the value(s) set to [closed]. Also if the function is called for a non-socket port, behave as well as possible (no status or statistics). OTP-17492 [kernel] More tweaking

view details

Micael Karlberg

commit sha c6d8967198e3e4515ed81cc3908821b92d658042

[kernel|test] Add (simple) test cases Add two simple test cases to is a very simple way verify that inet:info/1 behaves "properly". OTP-17492

view details

Micael Karlberg

commit sha 0aeeaeb95d12c0edcf50943a55e1dee3fbe16328

Merge branch 'bmk/kernel/20210614/inet_info_closed_socket/OTP-17492' into maint OTP-17492

view details

Micael Karlberg

commit sha aab9695d49da8850f769d855a9c3b896c7690b78

Merge branch 'maint' OTP-17492

view details

push time in 7 hours

issue closedelixir-lang/elixir

Error Message Lies

Environment

  • Elixir & Erlang/OTP versions (elixir --version):
Erlang/OTP 24 [erts-12.0.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]

Elixir 1.12.1 (compiled with Erlang/OTP 22)
  • Operating system: macOS Big Sur 11.2.3

Current behavior

iex(1)> String.to_existing_atom("valid_utf8")
** (ArgumentError) errors were found at the given arguments:

  * 1st argument: invalid UTF8 encoding

    :erlang.binary_to_existing_atom("valid_utf8", :utf8)

The error is a lie. It's valid UTF-8, it just doesn't exist as an atom.

Expected behavior

It would be great if it could tell us the atom doesn't exist. If that's not possible though, we should at least stop giving an incorrect reason.

closed time in 8 hours

JEG2

issue commentelixir-lang/elixir

Error Message Lies

Precisely, thanks @thiamsantos and @JEG2!

JEG2

comment created time in 8 hours

issue commentelixir-lang/elixir

Error Message Lies

I think it is the same error reported at https://github.com/elixir-lang/elixir/issues/11014. It seems to be already fixed in OTP https://github.com/erlang/otp/commit/c1942e39d44d50bb4bdf8e22456f31ee23931fdb.

JEG2

comment created time in 8 hours

issue openedelixir-lang/elixir

Error Message Lies

Environment

  • Elixir & Erlang/OTP versions (elixir --version):
Erlang/OTP 24 [erts-12.0.2] [source] [64-bit] [smp:16:16] [ds:16:16:10] [async-threads:1] [jit]

Elixir 1.12.1 (compiled with Erlang/OTP 22)
  • Operating system: macOS Big Sur 11.2.3

Current behavior

iex(1)> String.to_existing_atom("valid_utf8")
** (ArgumentError) errors were found at the given arguments:

  * 1st argument: invalid UTF8 encoding

    :erlang.binary_to_existing_atom("valid_utf8", :utf8)

The error is a lie. It's valid UTF-8, it just doesn't exist as an atom.

Expected behavior

It would be great if it could tell us the atom doesn't exist. If that's not possible though, we should at least stop giving an incorrect reason.

created time in 8 hours

issue commenterlang/otp

intermittent segfault / abort / stuck processes when setting schedulers_online system flag starting in OTP 20

@rickard-green: thanks, it looks like #4980 resolves the issue!

Applying it to OTP-23.3.4.4 and OTP-24.0.2, the above repro example runs cleanly in the standard and debug emulators, and the behavior above no longer occurs. Without the patch, one of the following still occurs:

  1. schedulers_online value stops changing / processes get stuck (standard+debug)
  2. emulator aborts with assertion (debug)

Will look into enabling more extensive local testing.

zerth

comment created time in 8 hours

pull request commentelixir-ecto/postgrex

correct formatting

:green_heart: :blue_heart: :purple_heart: :yellow_heart: :heart:

bryanhuntesl

comment created time in 9 hours

push eventelixir-ecto/postgrex

bryanhuntesl

commit sha fc129a9597e79ab7cb413c1d58615b85e81eb076

fix formatting (#553)

view details

push time in 9 hours

PR opened elixir-ecto/postgrex

correct formatting
+3 -3

0 comment

1 changed file

pr created time in 9 hours

pull request commenterlang/otp

ssl: Use new socket:monitor/1

Yes, it should work for "all" kinds of sockets. The function socket:monitor/1 is official, but is intended for when you only work with 'socket' sockets.

IngelaAndin

comment created time in 11 hours