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

go: add deadlock detector, improve locking #618

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Commits on Feb 17, 2023

  1. go: use deadlock.Mutex to check for deadlocks

    Signed-off-by: David Scott <[email protected]>
    djs55 committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    156398d View commit details
    Browse the repository at this point in the history
  2. go: update sirupsen/logrus

    Signed-off-by: David Scott <[email protected]>
    djs55 committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    15fd0be View commit details
    Browse the repository at this point in the history
  3. go: skip a Unix test on Windows

    Signed-off-by: David Scott <[email protected]>
    djs55 committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    8bca054 View commit details
    Browse the repository at this point in the history
  4. go: avoid acquiring the multiplexer mutex in channel

    The code is clearer if each object only acquires its own mutex, and
    doesn't reach into the mutexes of others (if possible)
    
    Signed-off-by: David Scott <[email protected]>
    djs55 committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    026682d View commit details
    Browse the repository at this point in the history
  5. go: avoid possible read/modify/write of the Write window

    The Write window is used to keep track of how much buffer space is
    free in the remote to avoid one connection blocking the rest.
    Previously we checked the window and decided how much to write, then
    dropped the metadata mutex before performing the write. In theory
    another Write call on the same connection could see that buffer
    size is free, send too much and block the connection.
    
    Therefore Write should take ownership of the space by bumping the
    `current` window before dropping the lock.
    
    Signed-off-by: David Scott <[email protected]>
    djs55 committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    30aec04 View commit details
    Browse the repository at this point in the history
  6. go: simplify the Write timeout handling

    Previously we had a complicated set of channels and a condition
    variable, and the condition variable Wait() was in a goroutine.
    
    Instead the Wait() is now in the main goroutine and an optional
    timeout is in an optional goroutine.
    
    Signed-off-by: David Scott <[email protected]>
    djs55 committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    e74d418 View commit details
    Browse the repository at this point in the history
  7. go: net.Conn allows concurrent Write() calls

    If multiple calls are blocked waiting for window space, we need to
    use Broadcast() to wake them all up on a window update.
    
    Signed-off-by: David Scott <[email protected]>
    djs55 committed Feb 17, 2023
    Configuration menu
    Copy the full SHA
    8d838a0 View commit details
    Browse the repository at this point in the history