Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fix client pooling for long-lived listens #614

Merged
merged 3 commits into from May 10, 2019
Merged

Commits on May 10, 2019

  1. Make acquire/release visible

    wilhuff committed May 10, 2019
    Copy the full SHA
    6c60ae8 View commit details
    Browse the repository at this point in the history
  2. Rename things in _initializeStream

    These names suggest that the returned Promise represents a stream that
    has completed and whose client is suitable to release back into the
    pool, when in fact, it only represents that the stream has successfully
    initialized.
    wilhuff committed May 10, 2019
    Copy the full SHA
    257ce2a View commit details
    Browse the repository at this point in the history
  3. Fixes firebase/firebase-admin-node#499

    Previously _initializeStream returned a Promise that indicated that the
    stream was "released", i.e. that it was was ready for attaching
    listeners.
    
    #256 Added pooled clients and changed the
    callers of _initializeStream to reuse this promise such that when it was
    resolved, the stream could be returned to the pool. This works when
    listeners are short-lived, but fails when listeners run indefinitely.
    
    This change arranges to release the clients back to the pool only after
    the stream has completed, which allows an arbitrary number of indefinite
    listens to run without problems.
    wilhuff committed May 10, 2019
    Copy the full SHA
    be865dc View commit details
    Browse the repository at this point in the history