Skip to content

Commit

Permalink
Merge pull request #115 from SMI/release/1.4.1
Browse files Browse the repository at this point in the history
Release/1.4.1
  • Loading branch information
tznind authored Feb 17, 2020
2 parents 3cdffa7 + d05218d commit 16bd353
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 10 deletions.
14 changes: 13 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

...

## [1.4.1] - 2020-02-17

### Added

- Added randomisation in the retry delay on DicomRelationalMapper (and set minimum wait duration to 10s)

### Fixed

- Fixed DLE Payload state being wrong when retrying batches (when it is half / completely consumed)
- Added lock on producer sending messages in IdentifierMapper

## [1.4.0] - 2020-02-14

### Added
Expand Down Expand Up @@ -147,7 +158,8 @@ First stable release after importing the repository from the private [SMIPlugin]
- Anonymous `MappingTableName` must now be fully specified to pass validation (e.g. `mydb.mytbl`). Previously skipping database portion was supported.


[Unreleased]: https://github.com/SMI/SmiServices/compare/v1.4.0...develop
[Unreleased]: https://github.com/SMI/SmiServices/compare/v1.4.1...develop
[1.4.1]: https://github.com/SMI/SmiServices/compare/v1.4.0...v1.4.1
[1.4.0]: https://github.com/SMI/SmiServices/compare/v1.3.1...v1.4.0
[1.3.1]: https://github.com/SMI/SmiServices/compare/v1.3.0...v1.3.1
[1.3.0]: https://github.com/SMI/SmiServices/compare/v1.2.3...v1.3.0
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
![GitHub](https://img.shields.io/github/license/SMI/SmiServices)
[![Total alerts](https://img.shields.io/lgtm/alerts/g/SMI/SmiServices.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/SMI/SmiServices/alerts/)

Version: `1.4.0`
Version: `1.4.1`

# SMI Services

Expand Down
6 changes: 3 additions & 3 deletions src/SharedAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
[assembly: AssemblyCulture("")]

// These should be overwritten by release builds
[assembly: AssemblyVersion("1.4.0")]
[assembly: AssemblyFileVersion("1.4.0")]
[assembly: AssemblyInformationalVersion("1.4.0")] // This one can have the extra build info after it
[assembly: AssemblyVersion("1.4.1")]
[assembly: AssemblyFileVersion("1.4.1")]
[assembly: AssemblyInformationalVersion("1.4.1")] // This one can have the extra build info after it
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ public DicomFileMessageToDatasetListWorklist(List<QueuedImage> messages)
_messages = messages;
}

/// <summary>
/// Resets the progress through the work list e.g. if half the list is consumed and you want to
/// start again.
/// </summary>
public void ResetProgress()
{
_progress = 0;
}

public DicomDataset GetNextDatasetToProcess(out string filename, out Dictionary<string, string> otherValuesToStoreInRow)
{
otherValuesToStoreInRow = new Dictionary<string, string>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public DicomRelationalMapperQueueConsumer(IRDMPPlatformRepositoryServiceLocator
_minimumBatchSize = options.MinimumBatchSize;
_useInsertIntoForRawMigration = options.UseInsertIntoForRAWMigration;
_retryOnFailureCount = options.RetryOnFailureCount;
_retryDelayInSeconds = options.RetryDelayInSeconds;
_retryDelayInSeconds = Math.Max(10,options.RetryDelayInSeconds);
_maximumRunDelayInSeconds = new TimeSpan(0, 0, 0, options.MaximumRunDelayInSeconds <= 0 ? 15 : 0);

StartDleRunnerTask();
Expand Down Expand Up @@ -220,6 +220,9 @@ private void RunDleIfRequired()

// We last ran now!
_lastRanDle = DateTime.Now;

//reset the progress e.g. if we crashed later on in the load
datasetProvider.ResetProgress();

try
{
Expand All @@ -233,8 +236,13 @@ private void RunDleIfRequired()

if (remainingRetries > 0)
{
Logger.Info("Sleeping " + _retryDelayInSeconds + "s after failure");
Task.Delay(new TimeSpan(0, 0, 0, _retryDelayInSeconds)).Wait();
//wait a random length of time averaging the _retryDelayInSeconds to avoid retrying at the same time as other processes
//where there is resource contention that results in simultaneous failures.
var r = new Random();
var wait = r.Next(_retryDelayInSeconds * 2);

Logger.Info("Sleeping " + wait + "s after failure");
Task.Delay(new TimeSpan(0, 0, 0, wait)).Wait();

if (RunChecks)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,10 @@ protected override void ProcessMessageImpl(IMessageHeader header, BasicDeliverEv
else
{
// Now ship it to the exchange
_producer.SendMessage(msg, header);

lock (_producer)
{
_producer.SendMessage(msg, header);
}
Ack(header, deliverArgs);
}
}
Expand Down

0 comments on commit 16bd353

Please sign in to comment.