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 hardcode number issue in replicate.StartBackup implementation #298

Merged
merged 5 commits into from
Jul 30, 2018

Conversation

zhaohaidao
Copy link
Contributor

Problem
Given timeout value is not used in replicate.StartBackup implementation

// From: https://github.com/siddontang/go-mysql/blob/master/replication/backup.go#L45
for {
    // The second arg should be timeout, not a hard code number
    ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
    ....
}

PS: I am curious how to test my code without travis ci environment.

c.Assert(err, IsNil)
done <- true
}()
failTimeout := 2 * timeout
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to make the test more stable, I think you should use a larger timeout here to ensure StartBackup timeout can work.

@siddontang siddontang merged commit 6207123 into go-mysql-org:master Jul 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants