Skip to content
  • Jonathan Hefner's avatar
    eba15349
    Listen on fork in EventedFileUpdateChecker · eba15349
    Jonathan Hefner authored
    The Listen gem does not notify across process forks, and so forked
    processes must re-create their listeners.  `EventedFileUpdateChecker`
    handled this in `updated?` by checking if `Process.pid` was different.
    Because file updates may have occurred after the start of the fork but
    before the call to `updated?`, `updated?` would always return true in
    this case.
    
    However, the above approach can result in unnecessary application
    reloading, particularly when using Spring.  That, in turn, can cause
    unexpected and problematic behavior: #39431, #37591.  This commit
    changes listener re-creation to occur immediately after fork, and
    changes `updated?` to return true only when necessary.
    eba15349
    Listen on fork in EventedFileUpdateChecker
    Jonathan Hefner authored
    The Listen gem does not notify across process forks, and so forked
    processes must re-create their listeners.  `EventedFileUpdateChecker`
    handled this in `updated?` by checking if `Process.pid` was different.
    Because file updates may have occurred after the start of the fork but
    before the call to `updated?`, `updated?` would always return true in
    this case.
    
    However, the above approach can result in unnecessary application
    reloading, particularly when using Spring.  That, in turn, can cause
    unexpected and problematic behavior: #39431, #37591.  This commit
    changes listener re-creation to occur immediately after fork, and
    changes `updated?` to return true only when necessary.
Loading