From f5069be7e29005fb277c2c059194ba7ebf5ddce4 Mon Sep 17 00:00:00 2001 From: William Yang Date: Mon, 27 Nov 2023 10:08:28 +0100 Subject: [PATCH 1/5] fix(build): remove workaround for emqx --- build.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/build.sh b/build.sh index ba55f40e..69ee0121 100755 --- a/build.sh +++ b/build.sh @@ -92,9 +92,3 @@ else fi fi -## workaround for emqx forked rebar3 -if ([ -n $REBAR_DEPS_DIR ] && [ $(realpath -P "${REBAR_DEPS_DIR}/quicer/priv") != "${PWD}/priv" ]); -then - cp -r priv/* "${REBAR_DEPS_DIR}/quicer/priv/" - cp include/quicer_vsn.hrl "${REBAR_DEPS_DIR}/quicer/include/" -fi From 831954f753d792d9e19a0149f3a6e4c0b124656d Mon Sep 17 00:00:00 2001 From: William Yang Date: Mon, 27 Nov 2023 11:20:55 +0100 Subject: [PATCH 2/5] chore: remove ; --- c_src/quicer_connection.c | 1 - 1 file changed, 1 deletion(-) diff --git a/c_src/quicer_connection.c b/c_src/quicer_connection.c index 75260b12..13c7fc6a 100644 --- a/c_src/quicer_connection.c +++ b/c_src/quicer_connection.c @@ -1749,7 +1749,6 @@ get_conn_owner1(ErlNifEnv *env, int argc, const ERL_NIF_TERM argv[]) goto exit; } res = SUCCESS(enif_make_pid(env, &(c_ctx->owner->Pid))); - ; exit: enif_mutex_unlock(c_ctx->lock); return res; From 648144be29c532942516b43b091d4ab8472a7e65 Mon Sep 17 00:00:00 2001 From: William Yang Date: Mon, 27 Nov 2023 11:59:59 +0100 Subject: [PATCH 3/5] doc: update todos --- docs/todo.org | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/docs/todo.org b/docs/todo.org index ba26d72f..79d11327 100644 --- a/docs/todo.org +++ b/docs/todo.org @@ -6,8 +6,6 @@ Feature todo list, priority descending -** Notify acceptors when listener is closed. - ** Stream behavior should able to handle multiple streams One process could become the owner of multiple streams in the scenario that these streams are correlated. @@ -15,30 +13,18 @@ that these streams are correlated. ** Impl ConfigurationLoadCredential Load QUIC_CREDENTIAL_CONFIG to configuration -** quicer_stream proc should able to handle more streams - -** Close configurations in resource destroy callback - ** Check shutdown connection wait for peer to close or not -** DONE Hibernate connection owner process since connection process is mostly idling -Doable via return value of callback fun. - ** Get/Set Context with lock protection set/get the callback context. ** New API: open_send(connection_handle(), Data, Flags) Open stream over this connection and send without starting the stream -** RegistrationShutdown -API for registrationshutdown, shutdown all connections under registration - ** Unintentional Transport Migration ** NIF Segfault recover -** Different Application Profile (low latency, high throughput) - ** NIF Upgrade * Improvements @@ -62,10 +48,6 @@ API for registrationshutdown, shutdown all connections under registration - check types. -- refactor DATAGRAM handling - -- Report StreamID in event: `new_stream` - - Level of APIs Current API are designd to easily migrate from TCP. From 41e920c9d75699e71728e30fa95700434cfe86ff Mon Sep 17 00:00:00 2001 From: William Yang Date: Mon, 27 Nov 2023 12:13:22 +0100 Subject: [PATCH 4/5] ci: fix hex publish --- rebar.config | 23 +++++++++++++++++++++-- src/quicer.app.src | 2 +- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/rebar.config b/rebar.config index e817c7e2..ea3e34ef 100644 --- a/rebar.config +++ b/rebar.config @@ -5,7 +5,7 @@ [{"(linux|darwin|solaris)", compile, "make build-nif"} ]}. -{deps, [{snabbkaffe, {git, "https://github.com/kafka4beam/snabbkaffe.git", {tag, "1.0.9"}}} +{deps, [{snabbkaffe, "1.0.9"} ]}. {profiles, @@ -41,11 +41,30 @@ {extended_start_script, true}]}. + +{project_plugins, [{coveralls, {git, "https://github.com/qzhuyan/coveralls-erl", {branch, "qzhuyan"}}} + , rebar3_hex + , rebar3_ex_doc + ]}. + %% Coveralls -{project_plugins, [{coveralls, {git, "https://github.com/qzhuyan/coveralls-erl", {branch, "qzhuyan"}}}]}. {cover_enabled, true}. {cover_excl_mods, [qt, qt_ssl, rev, user_default]}. {cover_export_enabled, true}. {coveralls_coverdata, "_build/test/cover/*.coverdata"}. % or a string with wildcards or a list of files {coveralls_service_name, "github"}. {coveralls_parallel, true}. + + +%% HEX publish +{hex, [{doc, ex_doc}]}. +{ex_doc, [ + {extras, [ "README.md" + , "LICENSE" + , "docs/messages_to_owner.md" + , "docs/Terminology.md" + , "docs/DesignDecisions.md" + ]}, + {main, "README.md"}, + {source_url, "https://github.com/emqx/quic"} + ]}. diff --git a/src/quicer.app.src b/src/quicer.app.src index ae7e3ed2..1f5c8844 100644 --- a/src/quicer.app.src +++ b/src/quicer.app.src @@ -20,7 +20,7 @@ , quicer_sup , quicer_nif]}, - {licenses, ["Apache 2.0"]}, + {licenses, ["Apache-2.0"]}, {links, [{"Github", "https://github.com/emqx/quic"}]}, {include_files, [ "CMakeLists.txt" , "Makefile" From 07e6ff0023a938bd99576ca022ac8e4430d8e293 Mon Sep 17 00:00:00 2001 From: William Yang Date: Mon, 27 Nov 2023 12:15:13 +0100 Subject: [PATCH 5/5] doc: update DesignDecisions --- docs/DesignDecisions.md | 46 +---------------------------------------- 1 file changed, 1 insertion(+), 45 deletions(-) diff --git a/docs/DesignDecisions.md b/docs/DesignDecisions.md index d01c32cb..4a2323ab 100644 --- a/docs/DesignDecisions.md +++ b/docs/DesignDecisions.md @@ -1,56 +1,12 @@ # Design Decisions This doc contains design decisions we have made and provides some insights about background and reasons -For each decision. +for each decision. If you don't agree with the decision or causing issue, please refer to the chapter number in the issue report. # Decisions -## Resources Managements - -1. Connection or Stream should not cross references - For example, in `s_ctx` it should not have a field `c_ctx`, because stream callback can still get called - While the `connection` in `c_ctx` is closed due to a close call, is asynchronous. - - To avoid getting access to an invalid handle (already closed), there should be no cross references among these resources. - - Access to invalid handles could lead to undefined behavior in MsQuic that includes segfault or abort due to assertions. - - However, keep ref counting is still required to avoid the MsQuic handle getting closed too early (it is still in use). - -1. MsQuic handle - All MsQuic handles should be only closed in resource dealloc callback. - - For tracking resources usage, quicer do not do refcnt on MsQuic handles, instead it relies on the Erlang garbage - Collection mechanism to track the refcnt on the MsQuic handle. - - To inc refcnt use: - - ``` c - - enif_make_resource - - // OR - - enif_keep_resource - - - ``` - - - To dec refcnt use: - - `enif_release_resource` - - *CONS* - - The resources are not closed/freed until the GC kicks in, that means the releasing resources will be delayed. - - This behavior also aligns with the delayed GC in BEAM. - - - It also requires in the Erlang process not to keep the unused/closed resources in the stack/heap, - otherwise it will cause memory leaks. - ## Send message to the owner 1. Messages with boxed types are copied to the owner's mailbox.