All Versions
Latest Version
Avg Release Cycle
30 days
Latest Release
1490 days ago

Changelog History
Page 2

  • v0.7.0.beta4 Changes

    December 25, 2018

    BREAK : (fio_cli) breaking API changes make this extension easier than ever to use... I do apologize for this, but part of the reason 0.7.0 is still in beta is to test the API itself for ease of use and readability.

    ๐Ÿ›  Fix : (fio) fixed a minor memory leak in cluster mode, caused by the root process not freeing the hash map used for child process subscription monitoring.

    ๐Ÿ›  Fix : (fio) fixed superfluous and potentially erroneous pub/sub engine callback calls to unsubscribe, caused by (mistakingly) reporting filter channel closure.

    ๐Ÿ›  Fix : (mustache, FIOBJ) added support for dot notation in mustache templates.

    ๐Ÿ›  Fix : (http/1.1) avoid processing further requests if the connection was closed.

    ๐Ÿ›  Fix : (fio_test) fixed some memory leaks in the testing functions.

    โšก๏ธ Update : (fio_cli) stylize and beautify FIO_CLI_PRINT_HEADER lines.

    โšก๏ธ Update : (fio) updated the automatic concurrency calculations to leave resources for the system when a negative value is provided (was only available for worker count calculations, now available for thread count as well).

  • v0.7.0.beta3 Changes

    December 13, 2018

    Fix : (fio) Fixed superfluous ping events that might occur after a fio_write (but before the scheduled write actually occurred).

    ๐Ÿ›  Fix : (mustache) updated the mustache parser to fix an issue with template loading path names. The partial template path resolution logic was re-written, fixed and improved (I hope). This also adds support for text in mustache lambda, though not applicable when used with FIOBJ.

    ๐Ÿ›  Fix : (fio) Prevent Read/Write Hooks from delaying fio_force_close when an error occures while polling a connection.

    ๐Ÿ›  Fix : (fio) Deletes Unix sockets once done listening. Fixes an issue where the files would remain intact.

    ๐Ÿ›  Fix : (fio) Replaced fio_malloc existing memory allocation / free-list implementation. This also fixes an issue with large memory pools being retained on multi-core systems with many reported CPU cores.

    ๐Ÿ›  Fix : (fio) The FIO_FORCE_MALLOC flag was fixed to accommodate for the fact that fio_malloc returns zeroed data (all bytes are set to zero) vs. the system's malloc which might return junk data.

    ๐Ÿ›  Fix : (http) fixes a possible memory leak in http_mimetype_register, where clearing the registry wouldn't free the FIOBJ Strings.

    โšก๏ธ Update : (cli) updated handling of empty strings in CLI values by ignoring the argument rather than printing an error or experiencing an undefined value.

    Optimization : (fio) pub/sub channel names appear to be (often) objects with a long life-span. Hence, these objects now use malloc (instead of fio_malloc). Also, temporary allocations in fio_subscribe were removed.

    Optimization : (fio) pub/sub meta-data information and callbacks now use an Array (instead of link lists and a hash map). This should improve cache locality when setting and retrieving pub/sub meta-data.

    Optimization : (fio) added an urgent task queue for outbound IO, possibly improving protection against non-evented / blocking user code.

    Optimization : (http) WebSocket broadcasting optimizations are now automated.

  • v0.7.0.beta2 Changes

    November 13, 2018

    Breaking Changes!

    A lot of the code was re-written and re-organized, minimizing the name space used by the core library and consolidating the core library into a two file library (fio.h and fio.c).

    ๐Ÿ’ฅ This translated directly to breaking the API and ABI and bumping the version number.

    This should make the library easier to copy and use as well as minimize possible name collisions (at the price of maintaining a couple of monolithic files as the core library).

    These are the main changes :

    Extracted the FIOBJ library from the core library, making it an add-on that could used by the extensions (such as the HTTP extension) rather than a core requirement.

    Condensed the core library and it's namespace to two files (fio.h and fio.c) - replaced all facil_ function names with fio_ to accommodate the new namespace.


    It's a choice to sacrifice ease of maintainability in favor of ease of use.

    ๐Ÿ‘€ Although two files are more difficult to maintain than 10 files (assuming it's the same amount of code)... it seems that two files are easier for other developers to copy and paste into their projects.

    โž• Added poll support to allow for performance testing and CYGWIN compatibility. The system epoll/kqueue calls should perform better for higher loads, but now you can see for yourself.

    Timers are now in user space, allowing for more timers and less kernel dependencies.

    The on_idle and on_finish settings in facil_run (now fio_start) were removed, replaced by the more flexible fio_state_callback_add approach.

    The fio_listen and http_listen functions now return the listening socket's uuid (much like fio_connect and http_connect did).

    The Protocol's on_shutdown callback is now expected to return a uint8_t, hinting at a requested timeout before the socket is forcefully closed. A return value of 0 will indicate immediate socket closure with an 8 second timeout for outgoing buffer flushing.

    The cluster messaging system and the Pub/Sub system were both refactored, the API changed and the FIOBJ dependency was removed. This change cascades to effect all the Pub/Sub system elements.

    The Pub/Sub system's use_pattern was replaced with the optional callback argument match (a function pointer), allowing for custom pattern matching approaches (such as implementing NATs and RabbitMQ pattern matching). The previous glob matching approach (Redis compatible) is available using the provided FIO_MATCH_GLOB function pointer.

    โฌ†๏ธ The WebSocket upgrade (http_upgrade2ws) now matches the SSE upgrade function (starts with the handle http_s * and named arguments come later).

    The CLI API and implementation was completely rewritten.

    The new code is slightly more "monolithic" (one long function does most of the work), but should waste less memory with a simpler API (also got rid of some persistent data).

    The Read/Write socket hooks were redesigned.

    An SSL/TLS API stub was designed for SSL/TLS library abstraction (not implemented yet).

    This API is experimental and might change as I author the first SSL/TLS library wrappers (roadmap includes OpenSSL and BearSSL).

    โšก๏ธ Update : (fio_mem => fio.h) updated the allocator defaults to lower the price of a longer life allocation. Reminder: the allocator was designed for short/medium allocation life-spans or large allocations (as they directly map to mmap). Now 16Kb will be considered a larger allocation and the price of holding on to memory is lower (less fragmentation).

    ๐Ÿ›  Fix : (fio) fixed a typo in the shutdown output. Credit to @bjeanes (Bo Jeanes) for the Iodine#39 PR.

    ๐Ÿ”‹ Feature : (FIOBJ) added mustache template support.

    Logo : Logo created by @area55git (Area55)

    ๐Ÿ“š Documentation : A new website!

  • v0.7.0.beta1 Changes

    November 13, 2018


  • v0.6.4 Changes

    ๐Ÿ›  Fix: (sock) fixed an issue where calls to sock_write could potentially add data to the outgoing queue even after sock_close in cases where the outgoing queue isn't empty.

    ๐Ÿ›  Fix: ( fixed a race condition between pre-scheduled tasks (defer calls) and the worker process initialization. The race condition might have resulted in some pre-scheduled tasks not running on all the workers.

    ๐Ÿ›  Fix: (http) fixed an issue with the HTTP request logging, where the peer address wasn't shown.

    ๐Ÿ›  Fix: (websocket) made sure that on_ready is never called before on_open returns.

    ๐Ÿ›  Fix: (fio_mem, facil, http) fixed compatibility issues with Alpine Linux distro and older OS X versions (< 10.12).

    ๐Ÿ›  Fix: (http) fixed the http_date2rfc2109 method where a space wasn't written to the buffer after the month name (resulting in a junk byte).

    ๐Ÿ›  Fix: (pubsub) made sure that newly registered engines get the full list of existing subscriptions (no need to call pubsub_engine_resubscribe).

    ๐Ÿ›  Fix: (facil) possible fix for protocol attachment with NULL protocol.

  • v0.6.3 Changes

    ๐Ÿ›  Fix: (fio_hashmap / fiobj_hash) fixed a possible issue that could occur when compacting a severely fragmented Hash (where the length of the new storage requirements is shorter than the fragmented ordered array of data).

    ๐Ÿ›  Fix: (http / websocket) fixed an issue where the WebSocket's on_close callback wouldn't be called if certain errors prevented the upgrade. Now the on_close callback is always called.

    ๐Ÿ›  Fix: (http) fixed an issue where the Content-Type header might be missing when sending unrecognized files. Now an additional best attempt to detect the content type (this time using the URL instead of the file name) will be performed. If no content type is detected, the default RFC content type will be attached (application/octet-stream).

    ๐Ÿ›  Fix: (http1_parser) fixed a possible unaligned memory access concern.

    ๐Ÿ›  Fix: (FIOBJ) fixed compiler compatibility concerns with the fiobj_num_new logic, removing some possibly undefined behavior.

    ๐Ÿ›  Fix: (facil) a missing on_data protocol callback (missing during facil_attach) will now call facil_quite, preventing the event from firing endlessly.

    โšก๏ธ Update: (http) the on_upgrade callback now supports SSE connections with sse protocol identifier and the http_upgrade2sse function.

    โšก๏ธ Update: (sock) initial support for TCP Fast Open (TFO) when listening for connections.

  • v0.6.2 Changes

    ๐Ÿ›  This version fixes a number of issues, including a serious issue that prevented sockets from fully flushing their buffer.

    ๐Ÿ›  This version also improved the shutdown and hot restart logic and fixes numerous issues with cluster mode an pub/sub services.

    โฌ†๏ธ It's recommended that all 0.6.0.beta, 0.6.0 and 0.6.1 upgrade to this version.

    ๐Ÿ”’ Security: (http1) added a hard-coded limit on the number of headers allowed per request (regardless of size). HTTP_MAX_HEADER_COUNT defaults to 128, which should be enough by all accounts.

    ๐Ÿ›  Fix: (pubsub, facil, redis-engine) fixed numerous cluster and Pub/Sub issues, including support for new on_startup callback for pubsub_engine_s objects (to make handling forks that much easier. This fixes a memory leak, a reference counting error that freed memory prematurely, message parsing errors on fragmented messages, an obsolete ping formatting error, and more.

    ๐Ÿ›  Fix: (sock, facil) fixed an issue where socket buffers wouldn't be completely cleared (the on_ready event wouldn't be properly re-armed). This was discovered as a serious issue and upgrading to 0.6.2 is recommended.

    ๐Ÿ›  Fix: (http) fixed an HTTP status string output error, where status codes above 410 would degrade to status 500 (internal error) instead of printing the correct status string to the response.

    ๐Ÿ›  Fix: (websockets) fixed a missing "close" packet signal that should have been sent immediately after the user's on_shutdown callback.

    ๐Ÿ›  Fix: (FIOBJ) fixed the fiobj_str_tmp function to add thread safety (temp string should be stored in the thread's local storage, not globally accessible).

    ๐Ÿ›  Fix: (redis) fixed a race condition in the Redis engine that could prevent publishing connections from being established in worker processes.

    ๐Ÿ›  Fix: (facil) fixed an issue where facil_attach wouldn't call the on_close callback if the failure was due to the file descriptor being equal to -1.

    ๐Ÿ›  Fix: (facil) fixed a signaling issue where a SIGUSR1 sent to a worker process might inadvertently shutdown the server instead or wind down the specific worker and re-spawn a new one.

    ๐Ÿ›  Fix: (facil) fixed a signal handling logic to make it async-safe, protecting it against possible deadlocks or cluster stream corruption.

    โšก๏ธ Update/Fix: (facil) the on_data event will no longer be fired for sockets that were flagged to be closed using sock_close.

    โšก๏ธ Update: (FIOBJ) updated the fiobj_str_readfile to allow for a negative stat_at position (calculated from the end of file of the file backwards).

    โšก๏ธ Update: (facil) strengthened the on_shutdown callback lock to prevent the on_shutdown callback from being called while the on_data callback (or other connection tasks) is running.

    โšก๏ธ Update: (facil) shutdown logic provides more time for socket buffers to flush (only when required).

  • v0.6.1 Changes

    ๐Ÿ›  Fix: (pubsub) fixed a possible issue where a channel name might be freed before it's callback is handled. This was overlooked during the Hash caching logic update that prevented key hashing when the last item of the ordered Hash is removed.

    ๐Ÿ›  Fix: (pubsub) pubsub will now compact the memory used for client and channel data if the storage becomes excessively fragmented.

    ๐Ÿ›  Fix: (hashmap) fixed a possible memory reading issue that could occur when a Hash contains only one object and that object is removed (causing a memory read into the location just before the Hash map's address).

    ๐Ÿ›  Fix: (defer) defer now prefers the statically allocated buffer over the dynamically allocated buffer when all tasks have completed, preventing the last allocated buffer from leaking during the shutdown stage.

    ๐Ÿ›  Fix: (websocket) subscriptions created during the on_close callback (besides indicating that the API was being abused) are now properly removed.

  • v0.6.0 Changes

    ๐Ÿ”– Version 0.6.0 is a major release, changing much of the extension API (HTTP, pub/sub, CLI) and some of the core API (i.e., moving the evio polling from level-triggered to one-shot polling, a rewrite to the dynamic object types FIOBJ, and more).

    ๐Ÿš€ The following updates are included in this release (in addition to the beta updates):

    ๐Ÿ›  Fix: (pubsub) Fixed an issue where deferred pub/sub messages would have udata2 set to udata1 instead of the actual correct value.

    ๐Ÿ›  Fix: (facil) Fixed the facil_is_running() function, which could crash if wasn't initialized before the function was called.

    ๐Ÿ›  Fix: (facil) Fix CPU limit detection. Negative values are now meaningful (fraction of CPU cores, so -2 == cores/2). Zero values are replaced by

    โšก๏ธ Update: (facil) Hot restart is now available for cluster mode. By sending the SIGUSR1 signal to the program, will shutdown any worker processes and re-spawn new workers, allowing for a hot restart feature. Disable using FACIL_DISABLE_HOT_RESTART

    โšก๏ธ Update: (facil) Dedicated system mode can be toggled by setting the FIO_DEDICATED_SYSTEM macro during compile time. When FIO_DEDICATED_SYSTEM is set, will assume all the CPU cores are available and it will activate threads sooner. When FIO_DEDICATED_SYSTEM is defined as 0, will limit thread to protect against slow user code (rather than attempt concurrent IO).

    โšก๏ธ Update: (fio_mem) replaced the double linked list logic with a single linked list to make the library more independent as well as reduce some operations.

    ๐Ÿ”จ As well as some refactoring and minor adjustments.

  • Changes

    ๐Ÿš€ This is a major release, changing much of the extension API (HTTP, pub/sub, CLI) and some of the core API (i.e., moving the evio polling to One-Shot polling).

    Migration isn't difficult, but is not transparent either.

    ๐Ÿ›  Fix (backported): (websocket_parser) The websocket parser had a memory offset and alignment handling issue in it's unmasking (XOR) logic and the new memory alignment protection code. The issue would impact the parser in rare occasions when multiple messages where pipelined in the internal buffer and their length produced an odd alignment (the issue would occur with very fast clients, or a very stressed server).

    ๐Ÿ›  Note About Fixes:

    • ๐Ÿ›  I simply rewrote much of the code to know if the issues I fixed were present in the 0.5.x version or not.

    I believe some things work better. Some of the locking concerns will have less contention and I think I fixed some issues in the fiobj core types as well as the http extension.

    However, experience tells me a new major release (0.6.0) is always more fragile than a patch release. I did my best to test the new code, but experience tells me my tests are often as buggy as the code they test.

    Anyway, I'm releasing 0.6.0 knowing it works better than the 0.5.8 version, but also knowing it wasn't battle tested just yet.

    ๐Ÿ”„ Changes!: (fiobj / objects):

    • Major API changes.

      The dynamic type library moved closer to's core, integrating itself into the HTTP request/response handling, the Pub/Sub engine, the Websocket internal buffer and practically every aspect of the library.

      This required some simplification of the fiobj and making sure future changes would require less of a migration process.

    • ๐Ÿ‘€ The Symbol and Couplet types were removed, along with nesting protection support (which nobody seemed to use anyway).

    • ๐ŸŽ We're back to static typing with enum, using macros and inline functions for type identification (better performance at the expense of making extendability somewhat harder).

    • ๐Ÿ‘€ Hashes are now 100% collision resistant and have improved memory locality, at the expense of using more memory and performing calling memcmp (this can be avoided when seeking / removing / deleting items, but not when overwriting items).

    ๐Ÿ”„ Changes!: (http):

    • ๐Ÿ“œ The HTTP API and engine was completely re-written (except the HTTP/1.1 parser), both to support future client mode (including chunked encoding for trailing headers) and to make routing and request parsing easier.

    • ๐ŸŽ The updates to the HTTP API might result in decreased performance during the HTTP request reading due to the need to allocate resources and possibly copy some of the data into dynamic storage... For example, header Hash Tables replaced header Arrays, improving lookup times and increasing creation time.

    • ๐Ÿ“œ The HTTP parser now breaks down long URI schemes into a short URI + host header (which might become an array if it's included anyway).

    ๐Ÿ”„ Changes!: (websocket):

    • The Websocket API includes numerous breaking changes, not least is the pub/sub API rewrite that now leverages FIOBJ Strings / Symbols.

    • websocket_write_each was deprecated (favoring a pub/sub only design).

    ๐Ÿ”„ Changes!: (pubsub):

    • The pubsub API was redesigned after re-evaluating the function of a pub/sub engine and in order to take advantage of the FIOBJ type system.

    • ๐Ÿ—„ Channel names now use a hash map with collision protection (using memcmp to compare channel names). The means that the 4 but trie is no longer in use and will be deprecated.

    ๐Ÿ”„ Changes!: (redis):

    • ๐Ÿšš The redis_engine was rewritten, along with the RESP parser, to reflect the changes in the new pubsub service and to remove obsolete code.

    ๐Ÿ”„ Changes!: (facil):

    • Slight API changes:

      • facil_last_tick now returns struct timespec instead of time_t, allowing for more accurate time stamping.
      • facil_cluster_send and facil_cluster_set_handler were redesigned to reflect the new cluster engine (now using Unix Sockets instead of pipes).
    • โšก๏ธ Internal updates to accommodate changes to other libraries.

    • ๐Ÿ‘ท Cluster mode now behaves as sentinel, re-spawning any crashed worker processes (except in DEBUG mode).

    ๐Ÿ”„ Changes!: (evio):

    • the evented IO library was redesigned for one-shot notifications, requiring a call to evio_add or evio_set_timer in order to receive future notifications.

      This was a significant change in behavior and the changes to the API (causing backwards incompatibility) were intentional.

    • ๐Ÿ”จ the code was refactored to separate system specific logic into different files. making it easier to support more systems in the future.

    ๐Ÿ”„ Changes!: (sock):

    • ๐Ÿ‘ the socket library now supports automatic Unix detection (set port to NULL and provide a valid Unix socket path in the address field).

    • ๐Ÿ–จ the socket library's Read/Write hooks API was revised, separating the function pointers from the user data. At server loads over 25%, this decreases the memory footprint.

    • ๐Ÿšš the socket library's packet buffer API was deprecated and all sock_write2(...) operations take ownership of the memory/file (enforce move).

    • โšก๏ธ The internal engine was updated, removing pre-allocated packet buffers altogether and enabling packet header allocation using malloc, which introduces a significant changes to the internal behavior, possibly effecting embedded systems.

    ๐Ÿ”„ Changes!: (defer):

    • โœ‚ Removed forking from the defer library, moving the fork logic into the main facil source code.

    • โฑ Defer thread pools and now include two weak functions that allow for customized thread scheduling (wakeup/wait). These are overwritten by (in facil.c).

      By default, defer will use nanosleep.

    ๐Ÿ”จ Refactoring: (fiobj) moved the underlying Dynamic Array and Hash Table logic into single file libraries that support void * pointers, allowing the same logic to be used for any C object collection (as well as the objects).