(Engine) Bugfix: Unlocking an unlocked mutex PANIC + Increase dispatcher job capacity via commandline (#371)

* Removes lock unlock timer and instead sets unlocks between getting a nonce and sending a payload. Increases dispatch channel buffer to deal with len(enabledCurrencies) > ~100

* Adds additional comments to help explain the situation

* Fixes bug that could unlock mutex too early

* Fixes LIES where Gemini gets a nonce and then proceeds to declare it doesn't get a nonce causing an unrecoverable lock

* Fun new concept! The creation of a tested timed mutex. Unlocking an unlocked mutex cannot occur and response can be checked to verify whether the mutex was unlocked from timeout or command.

* Adds new cmd parameter "dispatchjobbuffer"

* Expands comments and renames benchmark. Makes `Timer` property private

* Happy little linters

* Renames jobBuffer and all related instances to jobs limit

* Tiny error message update

* Grammatical fix and setting dispatch.Start to use defaults
This commit is contained in:
Scott
2019-10-29 14:00:45 +11:00
committed by Adrian Gallagher
parent 1805c40f20
commit 242b02c382
16 changed files with 301 additions and 139 deletions

View File

@@ -8,8 +8,8 @@ import (
)
const (
// DefaultJobBuffer defines a maxiumum amount of jobs allowed in channel
DefaultJobBuffer = 100
// DefaultJobsLimit defines a maxiumum amount of jobs allowed in channel
DefaultJobsLimit = 100
// DefaultMaxWorkers is the package default worker ceiling amount
DefaultMaxWorkers = 10
@@ -47,7 +47,6 @@ type Dispatcher struct {
// MaxWorkers defines max worker ceiling
maxWorkers int32
// Atomic values -----------------------
// Worker counter
count int32