In Erlang/OTP, using a `gen_server` to manage connection pools can lead to intermittent exhaustion when downstream dependencies experience latency. While the process remains active, the `gen_server` loop lacks a native timeout for individual message processing. If a request handler blocks on external I/O, the process cannot consume subsequent messages, causi
I am designing a Gleam service that must retry a write operation after transient failures, but the write is not idempotent, so a duplicate execution would corrupt state. Two documented approaches seem viable, and I cannot decide between them. The first is a plain recursive helper: wrap the write in a function returning Result , and recurse only on Error , ca
When using the erlang_time module to convert UTC timestamps to local time, a specific challenge arises during the 'fold' period of a Daylight Saving Time transition. In these instances, the same local time occurs twice as the clock shifts back. The current behavior of erlang_time:from_local/1 relies on the host system's IANA time zone database but appears to
Goal Recover the node to a stable state after a :release_handler upgrade fails. Constraints OTP’s release handler does not provide an automatic rollback. A failed callback leaves the node with a mixture of old and new modules. The decision to purge or keep partially loaded code is unclear, and the semantics of :code.purge vs :code.load_file differ across OTP
Accidental public API exposure due to export_all In Erlang modules, the -export/1 clause defines the public API. Using -export_all can inadvertently expose internal helper functions, especially when combined with OTP behaviours that rely on exported callbacks. This can lead to unintended remote calls or misuse. The community has documented that omitting func
OTP Logger per‑module filtering Since OTP 21, Logger supports custom filter modules that can be attached per handler. The handler’s filter is set to the module’s return value for each log message, allowing fine‑grained suppression of noise. Dynamic update concern When a filter module is edited and recompiled, the usual approach is to call logger:reload_handl
Context When restoring a Mnesia backup with :mnesia.restore/2 , the :default_op option controls how tables not explicitly named in the restore specification are handled. Documented values include :clear_tables , :keep_tables , and :skip_tables , but the exact semantics—especially whether :skip_tables preserves existing data or leaves the table absent—vary in
Integration Boundary: Gleam Language and Erlang OTP Gleam provides a native, typed actor framework via the gleam/otp library, which abstracts BEAM concurrency. Simultaneously, the language allows direct interoperability with Erlang's gen_server and other OTP behaviors through the @external attribute. While the gleam/otp implementation offers compile-time saf
Goal Upgrade a lightweight OTP application in a production cluster while keeping all nodes online. Constraints Stateful gen_server modules must survive the code change, dependencies must be pinned to avoid mismatched BEAM images, and the upgrade path must be reproducible. Unresolved Decision OTP’s release_handler offers a standard --upgrade workflow but its