made master retry count configurable.
Merge pull request #565 from dcapwell/masterRetryConfig

made master retry count configurable.
handle overflow when retry count gets larger