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 deadlock in txsub.System.Tick() and tx_bad_seq errors #815

Merged
merged 4 commits into from
Jan 17, 2019

Commits on Jan 16, 2019

  1. Fix deadlock in txsub.System.Tick() and tx_bad_seq errors

    This commit fixes to issues in `txsub` package. First, issue was a
    deadlock in `Tick()` function:
    
    ```go
    sys.tickMutex.Lock()
    if sys.tickInProgress {
      logger.Debug("ticking in progress")
      return
    }
    sys.tickInProgress = true
    sys.tickMutex.Unlock()
    ```
    
    When two `Tick()` methods were called simultanously one of them could
    `Lock()` the mutex without calling `Unlock()` it properly. This could
    basically break the `txsub` system as sequence number could not be
    updated.
    
    The second issue was a problem with `App` initialization.
    `App.networkPassphrase` was set to test network passphrase by default.
    If `txsub` system was initialized before updating the network passphrase
    using connected `stellar-core`, the system would not be able to
    correctly find the transaction result in a database as calculated hash
    was different than the actual hash of the transaction.
    bartekn committed Jan 16, 2019
    Configuration menu
    Copy the full SHA
    9acbd8b View commit details
    Browse the repository at this point in the history
  2. Fix tests

    bartekn committed Jan 16, 2019
    Configuration menu
    Copy the full SHA
    a3a0c80 View commit details
    Browse the repository at this point in the history

Commits on Jan 17, 2019

  1. Review comments

    bartekn committed Jan 17, 2019
    Configuration menu
    Copy the full SHA
    59446eb View commit details
    Browse the repository at this point in the history
  2. Fix test

    bartekn committed Jan 17, 2019
    Configuration menu
    Copy the full SHA
    8a0a886 View commit details
    Browse the repository at this point in the history