1. 27 Jul, 2018 5 commits
    • Joram Wilander's avatar
      6ac82d51
    • Joram Wilander's avatar
      Fix compile error caused by bad merge (#9176) · 441c8741
      Joram Wilander authored
      * Fix compile error caused by bad merge
      
      * Fix
      
      * Fix
      441c8741
    • Jesse Hallam's avatar
      MM-11431: handle plugin deadlocks (#9167) · 835c0871
      Jesse Hallam authored
      * ensure plugin is always shutdown
      
      Once we call `.client.Client()` the plugin has started, and must be shut
      down. `newSupervisor` sometimes returned with an error (and without a
      reference to the supervisor), leaving the client running indefinitely.
      
      * Clarify the documentation to explain that plugin hooks will not trigger until `OnActivate` returns successfully, and will stop triggering just before `OnDeactivate` is called.
      
      * test for plugin deadlock
      
      * plugin/environment.go: switch to sync.Map
      
      From: https://golang.org/pkg/sync/#Map
      
      > If a goroutine holds a RWMutex for reading and another goroutine might call Lock, no goroutine should expect to be able to acquire a read lock until the initial read lock is released. In particular, this prohibits recursive read locking. This is to ensure that the lock eventually becomes available; a blocked Lock call excludes new readers from acquiring the lock.
      
      The previous `RWMutex` was not safe given that we effectively acquired read locks recursively (hook -> api -> hook). This worked up until we activated or deactivated plugins, tried to acquire a write lock, and the plugin used the API to effectively trigger another hook.
      
      Switching to sync.Map avoids this by divesting the need to lock at all, avoiding the potential for a recursive lock in the first place.
      835c0871
    • Jesse Hallam's avatar
      s/mlog/log/ in apiRPCClient (#9171) · 1d9c1448
      Jesse Hallam authored
      We never actually initialized `log` on apiRPCClient, and it can't log
      without making an RPC call anyway, so just switch to logging errors from
      the plugin to STDERR instead.
      1d9c1448
    • Christopher Speller's avatar
      Adding FileWillBeUploaded plugin hook (#9169) · 026f0152
      Christopher Speller authored
      * Adding file upload hook.
      
      * Adding hook test for FileWillBeUploaded
      
      * Some debugging fixes.
      
      * Fix typo.
      
      * Fixing double close
      
      * Fix capitalization on docs.
      026f0152
  2. 26 Jul, 2018 5 commits
  3. 25 Jul, 2018 2 commits
  4. 24 Jul, 2018 3 commits
  5. 23 Jul, 2018 3 commits
  6. 20 Jul, 2018 7 commits
  7. 19 Jul, 2018 4 commits
  8. 18 Jul, 2018 8 commits
  9. 17 Jul, 2018 1 commit
  10. 16 Jul, 2018 2 commits