emqx/apps/emqx_utils
Thales Macedo Garitezi 50e7d5d2ec fix(nolink_apply): avoid sending late replies to caller
Due to race conditions, it's possible that the caller to `pmap`/`nolink_apply` might
receive a late reply.

e.g. when a timeout occurred while resource manager was checking a resource's health:

```
19:18:23.084 [error] [data: ..., event_data: {#Reference<0.3247872820.3887857670.131018>, {:normal, [false, true, true, true, true, true]}}, event_type: :info, msg: :ignore_all_other_events, state: :connected]
```

Using an alias and also checking for the race condition in the `after` block (like
[`gen`](a76bf63197/lib/stdlib/src/gen.erl (L270-L277))
does), we avoid polluting the caller's mailbox with late replies.
2023-06-16 17:03:39 -03:00
..
include fix: stale call to emqx_misc 2023-04-14 13:41:34 +02:00
src fix(nolink_apply): avoid sending late replies to caller 2023-06-16 17:03:39 -03:00
test fix(nolink_apply): avoid sending late replies to caller 2023-06-16 17:03:39 -03:00
README.md style: fix wording 2023-04-14 18:51:51 +02:00
rebar.config refactor: move emqx_json to emqx_utils_json 2023-04-14 13:31:27 +02:00

Erlang utility library for EMQX

Overview

emqx_utils is a collection of utility functions for EMQX, organized into several modules. It provides various functionalities to make it easier to work with EMQX, such as binary manipulations, maps, JSON en- and decoding, ets table handling, data conversions, and more.

Features

  • emqx_utils: unsorted helper functions, formerly known as emqx_misc - NEEDS WORK
  • emqx_utils_api: collection of helper functions for API responses
  • emqx_utils_binary: binary reverse, join, trim etc
  • emqx_utils_ets: convenience functions for creating and looking up data in ets tables.
  • emqx_utils_json: JSON encoding and decoding
  • emqx_utils_maps: convenience functions for map lookup and manipulation like deep_get etc.

Contributing

Please see our contributing guidelines for information on how to contribute to emqx_utils. We welcome bug reports, feature requests, and pull requests.