facil.io v0.6.0.dev Release Notes

  • ๐Ÿš€ 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 / facil.io objects):

    • Major API changes.

      The facil.io dynamic type library moved closer to facil.io'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 facil.io (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 facil.io objects).