Blame ROADMAP

Packit 90a5c9
APACHE 2.x ROADMAP
Packit 90a5c9
==================
Packit 90a5c9
Last modified at [$Date: 2010-10-30 17:56:13 +0000 (Sat, 30 Oct 2010) $]
Packit 90a5c9
Packit 90a5c9
Packit 90a5c9
WORKS IN PROGRESS
Packit 90a5c9
-----------------
Packit 90a5c9
Packit 90a5c9
    * Source code should follow style guidelines.
Packit 90a5c9
      OK, we all agree pretty code is good.  Probably best to clean this
Packit 90a5c9
      up by hand immediately upon branching a 2.1 tree.
Packit 90a5c9
      Status: Justin volunteers to hand-edit the entire source tree ;)
Packit 90a5c9
Packit 90a5c9
      Justin says:
Packit 90a5c9
        Recall when the release plan for 2.0 was written:
Packit 90a5c9
            Absolute Enforcement of an "Apache Style" for code.
Packit 90a5c9
        Watch this slip into 3.0.
Packit 90a5c9
Packit 90a5c9
      David says:
Packit 90a5c9
        The style guide needs to be reviewed before this can be done.
Packit 90a5c9
        http://httpd.apache.org/dev/styleguide.html
Packit 90a5c9
        The current file is dated April 20th 1998!
Packit 90a5c9
Packit 90a5c9
        OtherBill offers:
Packit 90a5c9
          It's survived since '98 because it's welldone :-)  Suggest we
Packit 90a5c9
          simply follow whatever is documented in styleguide.html as we
Packit 90a5c9
          branch the next tree.  Really sort of straightforward, if you
Packit 90a5c9
          dislike a bit within that doc, bring it up on the dev@httpd
Packit 90a5c9
          list prior to the next branch.
Packit 90a5c9
Packit 90a5c9
      So Bill sums up ... let's get the code cleaned up in CVS head.
Packit 90a5c9
      Remember, it just takes cvs diff -b (that is, --ignore-space-change)
Packit 90a5c9
      to see the code changes and ignore that cruft.  Get editing Justin :)
Packit 90a5c9
Packit 90a5c9
    * Replace stat [deferred open] with open/fstat in directory_walk.
Packit 90a5c9
      Justin, Ian, OtherBill all interested in this.  Implies setting up
Packit 90a5c9
      the apr_file_t member in request_rec, and having all modules use
Packit 90a5c9
      that file, and allow the cleanup to close it [if it isn't a shared,
Packit 90a5c9
      cached file handle.]
Packit 90a5c9
Packit 90a5c9
    * The Async Apache Server implemented in terms of APR.
Packit 90a5c9
      [Bill Stoddard's pet project.]
Packit 90a5c9
      Message-ID: <008301c17d42$9b446970$01000100@sashimi> (dev@apr)
Packit 90a5c9
Packit 90a5c9
        OtherBill notes that this can proceed in two parts...
Packit 90a5c9
Packit 90a5c9
           Async accept, setup, and tear-down of the request 
Packit 90a5c9
           e.g. dealing with the incoming request headers, prior to
Packit 90a5c9
           dispatching the request to a thread for processing.
Packit 90a5c9
           This doesn't need to wait for a 2.x/3.0 bump.
Packit 90a5c9
Packit 90a5c9
           Async delegation of the entire request processing chain
Packit 90a5c9
           Too many handlers use stack storage and presume it is 
Packit 90a5c9
           available for the life of the request, so a complete 
Packit 90a5c9
           async implementation would need to happen 3.0 release.
Packit 90a5c9
Packit 90a5c9
        Brian notes that async writes will provide a bigger
Packit 90a5c9
        scalability win than async reads for most servers.
Packit 90a5c9
        We may want to try a hybrid sync-read/async-write MPM
Packit 90a5c9
        as a next step.  This should be relatively easy to
Packit 90a5c9
        build: start with the current worker or leader/followers
Packit 90a5c9
        model, but hand off each response brigade to a "completion
Packit 90a5c9
        thread" that multiplexes writes on many connections, so
Packit 90a5c9
        that the worker thread doesn't have to wait around for
Packit 90a5c9
        the sendfile to complete.
Packit 90a5c9
Packit 90a5c9
Packit 90a5c9
MAKING APACHE REPOSITORY-AGNOSTIC
Packit 90a5c9
(or: remove knowledge of the filesystem)
Packit 90a5c9
Packit 90a5c9
[ 2002/10/01: discussion in progress on items below; this isn't
Packit 90a5c9
  planned yet ]
Packit 90a5c9
Packit 90a5c9
    * dav_resource concept for an HTTP resource ("ap_resource")
Packit 90a5c9
Packit 90a5c9
    * r->filename, r->canonical_filename, r->finfo need to
Packit 90a5c9
      disappear. All users need to use new APIs on the ap_resource
Packit 90a5c9
      object.
Packit 90a5c9
      
Packit 90a5c9
      (backwards compat: today, when this occurs with mod_dav and a
Packit 90a5c9
       custom backend, the above items refer to the topmost directory
Packit 90a5c9
       mapped by a location; e.g. docroot)
Packit 90a5c9
Packit 90a5c9
      Need to preserve a 'filename'-like string for mime-by-name
Packit 90a5c9
      sorts of operations.  But this only needs to be the name itself
Packit 90a5c9
      and not a full path.
Packit 90a5c9
Packit 90a5c9
      Justin: Can we leverage the path info, or do we not trust the
Packit 90a5c9
              user?
Packit 90a5c9
Packit 90a5c9
      gstein: well, it isn't the "path info", but the actual URI of
Packit 90a5c9
              the resource. And of course we trust the user... that is
Packit 90a5c9
              the resource they requested.
Packit 90a5c9
              
Packit 90a5c9
              dav_resource->uri is the field you want. path_info might
Packit 90a5c9
              still exist, but that portion might be related to the
Packit 90a5c9
              CGI concept of "path translated" or some other further
Packit 90a5c9
              resolution.
Packit 90a5c9
              
Packit 90a5c9
              To continue, I would suggest that "path translated" and
Packit 90a5c9
              having *any* path info is Badness. It means that you did
Packit 90a5c9
              not fully resolve a resource for the given URI. The
Packit 90a5c9
              "abs_path" in a URI identifies a resource, and that
Packit 90a5c9
              should get fully resolved. None of this "resolve to
Packit 90a5c9
              <here> and then we have a magical second resolution
Packit 90a5c9
              (inside the CGI script)" or somesuch.
Packit 90a5c9
   
Packit 90a5c9
      Justin: Well, let's consider mod_mbox for a second.  It is sort of
Packit 90a5c9
              a virtual filesystem in its own right - as it introduces
Packit 90a5c9
              it's own notion of a URI space, but it is intrinsically
Packit 90a5c9
              tied to the filesystem to do the lookups.  But, for the
Packit 90a5c9
              portion that isn't resolved on the file system, it has
Packit 90a5c9
              its own addressing scheme.  Do we need the ability to
Packit 90a5c9
              layer resolution?
Packit 90a5c9
Packit 90a5c9
    * The translate_name hook goes away
Packit 90a5c9
Packit 90a5c9
      Wrowe altogether disagrees.  translate_name today even operates
Packit 90a5c9
      on URIs ... this mechansim needs to be preserved.
Packit 90a5c9
    
Packit 90a5c9
    * The doc for map_to_storage is totally opaque to me. It has
Packit 90a5c9
      something to do with filesystems, but it also talks about
Packit 90a5c9
      security and per_dir_config and other stuff. I presume something
Packit 90a5c9
      needs to happen there -- at least better doc.
Packit 90a5c9
Packit 90a5c9
      Wrowe agrees and will write it up.
Packit 90a5c9
Packit 90a5c9
    * The directory_walk concept disappears. All configuration is
Packit 90a5c9
      tagged to Locations. The "mod_filesystem" module might have some
Packit 90a5c9
      internal concept of the same config appearing in multiple
Packit 90a5c9
      places, but that is handled internally rather than by Apache
Packit 90a5c9
      core.
Packit 90a5c9
Packit 90a5c9
      Wrowe suggests this is wrong, instead it's private to filesystem
Packit 90a5c9
      requests, and is already invoked from map_to_storage, not the core
Packit 90a5c9
      handler.  <Directory > and <Files > blocks are preserved as-is,
Packit 90a5c9
      but <Directory > sections become specific to the filesystem handler
Packit 90a5c9
      alone.  Because alternate filesystem schemes could be loaded, this
Packit 90a5c9
      should be exposed, from the core, for other file-based stores to 
Packit 90a5c9
      share. Consider an archive store where the layers become 
Packit 90a5c9
      <Directory path> -> <Archive store> -> <File name>
Packit 90a5c9
   
Packit 90a5c9
      Justin: How do we map Directory entries to Locations?
Packit 90a5c9
 
Packit 90a5c9
    * The "Location tree" is an in-memory representation of the URL
Packit 90a5c9
      namespace. Nodes of the tree have configuration specific to that
Packit 90a5c9
      location in the namespace.
Packit 90a5c9
      
Packit 90a5c9
      Something like:
Packit 90a5c9
      
Packit 90a5c9
      typedef struct {
Packit 90a5c9
          const char *name;  /* name of this node relative to parent */
Packit 90a5c9
Packit 90a5c9
          struct ap_conf_vector_t *locn_config;
Packit 90a5c9
Packit 90a5c9
          apr_hash_t *children; /* NULL if no child configs */
Packit 90a5c9
      } ap_locn_node;
Packit 90a5c9
Packit 90a5c9
      The following config:
Packit 90a5c9
      
Packit 90a5c9
      <Location /server-status>
Packit 90a5c9
          SetHandler server-status
Packit 90a5c9
          Order deny,allow
Packit 90a5c9
          Deny from all
Packit 90a5c9
          Allow from 127.0.0.1
Packit 90a5c9
      </Location>
Packit 90a5c9
      
Packit 90a5c9
      Creates a node with name=="server_status", and the node is a
Packit 90a5c9
      child of the "/" node. (hmm. node->name is redundant with the
Packit 90a5c9
      hash key; maybe drop node->name)
Packit 90a5c9
      
Packit 90a5c9
      In the config vector, mod_access has stored its Order, Deny, and
Packit 90a5c9
      Allow configs. mod_core has stored the SetHandler.
Packit 90a5c9
      
Packit 90a5c9
      During the Location walk, we merge the config vectors normally.
Packit 90a5c9
      
Packit 90a5c9
      Note that an Alias simply associates a filesystem path (in
Packit 90a5c9
      mod_filesystem) with that Location in the tree. Merging
Packit 90a5c9
      continues with child locations, but a merge is never done
Packit 90a5c9
      through filesystem locations. Config on a specific subdir needs
Packit 90a5c9
      to be mapped back into the corresponding point in the Location
Packit 90a5c9
      tree for proper merging.
Packit 90a5c9
Packit 90a5c9
    * Config is parsed into a tree, as we did for the 2.0 timeframe,
Packit 90a5c9
      but that tree is just a representation of the config (for
Packit 90a5c9
      multiple runs and for in-memory manipulation and usage). It is
Packit 90a5c9
      unrelated to the "Location tree".
Packit 90a5c9
Packit 90a5c9
    * Calls to apr_file_io functions generally need to be replaced
Packit 90a5c9
      with operations against the ap_resource. For example, rather
Packit 90a5c9
      than calling apr_dir_open/read/close(), a caller uses
Packit 90a5c9
      resource->repos->get_children() or somesuch.
Packit 90a5c9
Packit 90a5c9
      Note that things like mod_dir, mod_autoindex, and mod_negotiation
Packit 90a5c9
      need to be converted to use these mechanisms so that their
Packit 90a5c9
      functions will work on logical repositories rather than just
Packit 90a5c9
      filesystems.
Packit 90a5c9
Packit 90a5c9
    * How do we handle CGI scripts?  Especially when the resource may
Packit 90a5c9
      not be backed by a file?  Ideally, we should be able to come up
Packit 90a5c9
      with some mechanism to allow CGIs to work in a
Packit 90a5c9
      repository-independent manner.
Packit 90a5c9
Packit 90a5c9
      - Writing the virtual data as a file and then executing it?
Packit 90a5c9
      - Can a shell be executed in a streamy manner?  (Portably?)
Packit 90a5c9
      - Have an 'execute_resource' hook/func that allows the
Packit 90a5c9
        repository to choose its manner - be it exec() or whatever.
Packit 90a5c9
        - Won't this approach lead to duplication of code?  Helper fns?
Packit 90a5c9
Packit 90a5c9
      gstein: PHP, Perl, and Python scripts are nominally executed by
Packit 90a5c9
              a filter inserted by mod_php/perl/python. I'd suggest
Packit 90a5c9
              that shell/batch scripts are similar.
Packit 90a5c9
Packit 90a5c9
              But to ask further: what if it is an executable
Packit 90a5c9
              *program* rather than just a script? Do we yank that out
Packit 90a5c9
              of the repository, drop it onto the filesystem, and run
Packit 90a5c9
              it? eeewwwww...
Packit 90a5c9
              
Packit 90a5c9
              I'll vote -0.9 for CGIs as a filter. Keep 'em handlers.
Packit 90a5c9
Packit 90a5c9
      Justin: So, do we give up executing CGIs from virtual repositories?
Packit 90a5c9
              That seems like a sad tradeoff to make.  I'd like to have
Packit 90a5c9
              my CGI scripts under DAV (SVN) control.
Packit 90a5c9
Packit 90a5c9
    * How do we handle overlaying of Location and Directory entries?
Packit 90a5c9
      Right now, we have a problem when /cgi-bin/ is ScriptAlias'd and
Packit 90a5c9
      mod_dav has control over /.  Some people believe that /cgi-bin/
Packit 90a5c9
      shouldn't be under DAV control, while others do believe it
Packit 90a5c9
      should be.  What's the right strategy?