Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

fix(binding):overflow of StoreUint64 trait, modify foo_ to inner_foo #251

Merged
merged 7 commits into from
Apr 23, 2020

Conversation

cosinlink
Copy link
Contributor

What type of PR is this?
bug
What this PR does / why we need it:
fix bug of StoreUint64 overflow panic
Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

@muta-bot
Copy link

muta-bot bot commented Apr 21, 2020

Accept request.

@cosinlink cosinlink changed the title fix overflow of StoreUint64 trait, modify foo_ to inner_foo fix(binding):overflow of StoreUint64 trait, modify foo_ to inner_foo Apr 21, 2020
@cosinlink cosinlink requested review from nolanxyg and yejiayu April 21, 2020 13:14
@muta-bot
Copy link

muta-bot bot commented Apr 21, 2020

Accept request.

@muta-bot
Copy link

muta-bot bot commented Apr 21, 2020

Docker builded. "mutadev/muta:aa3c7a7"
Run chaos test on k8s named "muta-pr251"
Test lasts 4 hours

@muta-bot
Copy link

muta-bot bot commented Apr 21, 2020

Date(muta-pr251) 1 2 3 4
2020-04-21T13:37:50.004Z 0 0 0 0
2020-04-21T13:47:50.032Z 171 171 171 171
2020-04-21T13:57:50.064Z 345 345 345 345
2020-04-21T14:07:50.100Z 519 519 519 519
2020-04-21T14:17:50.132Z 687 687 687 687
2020-04-21T14:27:50.168Z 859 859 859 859
2020-04-21T14:37:50.204Z 1035 1035 1035 1035
2020-04-21T14:47:50.240Z 1207 1207 1207 1207
2020-04-21T14:57:50.276Z 1379 1379 1379 1379
2020-04-21T15:07:50.320Z 1555 1555 1555 1555
2020-04-21T15:17:50.352Z 1727 1727 1727 1727
2020-04-21T15:27:50.388Z 1901 1901 1901 1901
2020-04-21T15:37:50.424Z 2075 2075 2075 2075
2020-04-21T15:47:50.456Z 2247 2247 2247 2247
2020-04-21T15:57:50.488Z 2423 2423 2423 2423
2020-04-21T16:07:50.524Z 2597 2597 2597 2597
2020-04-21T16:17:50.552Z 2771 2771 2771 2771
2020-04-21T16:27:50.592Z 2945 2945 2945 2945
2020-04-21T16:37:50.632Z 3119 3119 3119 3119
2020-04-21T16:47:50.668Z 3295 3295 3295 3295
2020-04-21T16:57:50.704Z 3467 3467 3467 3467
2020-04-21T17:07:50.736Z 3643 3643 3643 3643
2020-04-21T17:17:50.772Z 3815 3815 3815 3815
2020-04-21T17:27:50.808Z 3991 3991 3991 3991

@muta-bot
Copy link

muta-bot bot commented Apr 22, 2020

Accept request.

@muta-bot
Copy link

muta-bot bot commented Apr 22, 2020

Docker builded. "mutadev/muta:83d59ac"
Run chaos test on k8s named "muta-pr251"
Test lasts 4 hours

@muta-bot
Copy link

muta-bot bot commented Apr 22, 2020

Accept request.

}
}
}

impl<S: ServiceState> StoreUint64 for DefaultStoreUint64<S> {
fn get(&self) -> u64 {
self.get_()
.unwrap_or_else(|e| panic!("StoreUint64 get failed: {}", e))
self.inner_get()
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove fn inner_xx method, and move the logic to fn xx trait method.
The reason of inner_xx existed is historical.

Copy link
Contributor

Choose a reason for hiding this comment

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

Agreed, but refactoring may not be included here because the focus of this PR is to solve the overflow.

@muta-bot
Copy link

muta-bot bot commented Apr 22, 2020

Docker builded. "mutadev/muta:0b0c6d8"
Run chaos test on k8s named "muta-pr251"
Test lasts 4 hours

@@ -234,27 +234,27 @@ pub trait StoreUint64 {

// Add val with self
// And set the result back to self
fn add(&mut self, val: u64);
fn add(&mut self, val: u64) -> bool;
Copy link
Contributor

Choose a reason for hiding this comment

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

How about name the method fn safe_xx ?
Because we had took care of math overflow.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i think right

@muta-bot
Copy link

muta-bot bot commented Apr 22, 2020

Accept request.

@muta-bot
Copy link

muta-bot bot commented Apr 22, 2020

Docker builded. "mutadev/muta:c2995d9"
Run chaos test on k8s named "muta-pr251"
Test lasts 4 hours

yejiayu
yejiayu previously approved these changes Apr 22, 2020
Copy link
Contributor

@yejiayu yejiayu left a comment

Choose a reason for hiding this comment

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

Wait for the four-node test to finish.

nolanxyg
nolanxyg previously approved these changes Apr 22, 2020
@muta-bot
Copy link

muta-bot bot commented Apr 22, 2020

Date(muta-pr251) 1 2 3 4
2020-04-22T10:01:42.472Z 0 0 0 0
2020-04-22T10:11:42.508Z 171 169 171 171
2020-04-22T10:21:42.804Z 331 329 331 331
2020-04-22T10:31:43.092Z 495 494 495 495
2020-04-22T10:41:43.220Z 663 662 663 663
2020-04-22T10:51:43.312Z 828 828 828 828
2020-04-22T11:01:43.500Z
2020-04-22T11:11:43.508Z
2020-04-22T11:21:43.516Z
2020-04-22T11:31:43.528Z
2020-04-22T11:41:43.540Z
2020-04-22T11:51:43.568Z
2020-04-22T12:01:43.576Z
2020-04-22T12:11:43.596Z
2020-04-22T12:21:43.612Z
2020-04-22T12:31:43.620Z
2020-04-22T12:41:43.628Z
2020-04-22T12:51:43.648Z
2020-04-22T13:01:43.664Z
2020-04-22T13:11:43.688Z
2020-04-22T13:21:43.696Z
2020-04-22T13:31:43.704Z
2020-04-22T13:41:43.728Z
2020-04-22T13:51:43.748Z

@cosinlink cosinlink dismissed stale reviews from nolanxyg and yejiayu via c4da9fd April 22, 2020 14:35
@muta-bot
Copy link

muta-bot bot commented Apr 22, 2020

Accept request.

@muta-bot
Copy link

muta-bot bot commented Apr 22, 2020

Docker builded. "mutadev/muta:c4da9fd"
Run chaos test on k8s named "muta-pr251"
Test lasts 4 hours

@muta-bot
Copy link

muta-bot bot commented Apr 22, 2020

Accept request.

@muta-bot
Copy link

muta-bot bot commented Apr 22, 2020

Docker builded. "mutadev/muta:e996965"
Run chaos test on k8s named "muta-pr251"
Test lasts 4 hours

@muta-bot
Copy link

muta-bot bot commented Apr 22, 2020

Date(muta-pr251) 1 2 3 4
2020-04-22T14:47:13.952Z 0 0 0 0
2020-04-22T14:57:13.988Z 171 171 171 171
2020-04-22T15:07:14.016Z 343 343 343 343
2020-04-22T15:17:14.048Z 515 515 515 515
2020-04-22T15:27:14.076Z 687 687 687 687
2020-04-22T15:37:14.108Z 859 859 859 859
2020-04-22T15:47:14.140Z 1031 1031 1031 1031
2020-04-22T15:57:14.176Z 1201 1201 1201 1201
2020-04-22T16:07:14.204Z 1373 1373 1373 1373
2020-04-22T16:17:14.232Z 1547 1547 1547 1547
2020-04-22T16:27:14.268Z 1719 1719 1719 1719
2020-04-22T16:37:14.300Z 1891 1891 1891 1891
2020-04-22T16:47:14.336Z 2063 2063 2063 2063
2020-04-22T16:57:14.372Z 2235 2235 2235 2235
2020-04-22T17:07:14.416Z 2409 2409 2409 2409
2020-04-22T17:17:14.448Z 2583 2583 2583 2583
2020-04-22T17:27:14.480Z 2755 2755 2755 2755
2020-04-22T17:37:14.516Z 2927 2927 2927 2927
2020-04-22T17:47:14.552Z 3099 3099 3099 3099
2020-04-22T17:57:14.592Z 3271 3271 3271 3271
2020-04-22T18:07:14.620Z 3445 3445 3445 3445
2020-04-22T18:17:14.656Z 3619 3619 3619 3619
2020-04-22T18:27:14.704Z 3791 3791 3791 3791
2020-04-22T18:37:14.748Z 3963 3963 3963 3963

@yejiayu yejiayu merged commit 2eeb2ce into nervosnetwork:master Apr 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants