-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
Provide error codes for enhancing error handling from clients #927
Conversation
WalkthroughThe changes introduce major updates to error handling and mapping across several files in the Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant YorkieServer
participant Document
Client->>YorkieServer: WatchDocument()
YorkieServer->>YorkieServer: Check conditions
alt Conditions met
YorkieServer->>Document: Find active client info
Document-->>YorkieServer: Return info
YorkieServer-->>Client: Proceed with operations
else Conditions not met
YorkieServer-->>Client: Return error
end
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #927 +/- ##
==========================================
- Coverage 50.86% 50.80% -0.07%
==========================================
Files 70 71 +1
Lines 10551 10564 +13
==========================================
Hits 5367 5367
- Misses 4652 4665 +13
Partials 532 532 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Outside diff range and nitpick comments (2)
api/converter/errors.go (1)
10-26
: LGTM! But consider handling cases where no error code is found.The function correctly extracts error codes from
connect.Error
types.However, returning an empty string if no error code is found might not be informative. Consider returning a default error code or logging this case for better debugging.
server/rpc/connecthelper/status.go (1)
90-131
: LGTM!The
errorToCode
variable correctly maps various errors to their string representations.Acknowledging the TODO comment: Automating the generation of this map would indeed be beneficial for maintainability.
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (3)
- api/converter/errors.go (1 hunks)
- server/rpc/connecthelper/status.go (5 hunks)
- server/rpc/testcases/testcases.go (25 hunks)
Additional comments not posted (21)
server/rpc/connecthelper/status.go (7)
Line range hint
39-89
:
LGTM!The
errorToConnectCode
variable correctly maps various errors to appropriateconnect.Code
.
133-145
: LGTM!The
CodeOf
function correctly unwraps the error to its root cause and retrieves the string representation fromerrorToCode
.
147-170
: LGTM!The
errorToConnectError
function correctly maps the error toconnect.Code
and adds error details if available.
172-189
: LGTM!The
structErrorToConnectError
function correctly handlesvalidation.StructError
and converts it toconnect.Error
with appropriate details.
Line range hint
191-208
:
LGTM!The
badRequestFromError
function correctly handlesvalidation.StructError
and constructs aBadRequest
with field violations.
210-227
: LGTM!The
ToStatusError
function correctly maps the error toconnect.Error
using the previously defined functions.
Line range hint
228-241
:
LGTM!The
ToRPCCodeString
function correctly unwraps the error to its root cause and retrieves the string representation fromerrorToConnectCode
.server/rpc/testcases/testcases.go (14)
74-74
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.Also applies to: 80-80, 87-87
123-123
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.Also applies to: 134-134, 145-145, 156-156, 178-178, 188-188, 202-202, 218-218
272-272
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.
380-380
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.Also applies to: 392-392, 409-409
462-462
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.
515-515
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.
568-568
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.Also applies to: 585-585
667-667
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.
693-693
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.
731-731
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.
808-808
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.
895-895
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.
955-955
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.
1015-1015
: LGTM!The new assertions using
connecthelper.CodeOf
andconverter.ErrorCodeOf
enhance error handling by verifying the error codes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go Benchmark
Benchmark suite | Current: e76b42d | Previous: 4b9913a | Ratio |
---|---|---|---|
BenchmarkDocument/constructor_test |
1529 ns/op 1337 B/op 24 allocs/op |
1492 ns/op 1337 B/op 24 allocs/op |
1.02 |
BenchmarkDocument/constructor_test - ns/op |
1529 ns/op |
1492 ns/op |
1.02 |
BenchmarkDocument/constructor_test - B/op |
1337 B/op |
1337 B/op |
1 |
BenchmarkDocument/constructor_test - allocs/op |
24 allocs/op |
24 allocs/op |
1 |
BenchmarkDocument/status_test |
929.9 ns/op 1305 B/op 22 allocs/op |
918.9 ns/op 1305 B/op 22 allocs/op |
1.01 |
BenchmarkDocument/status_test - ns/op |
929.9 ns/op |
918.9 ns/op |
1.01 |
BenchmarkDocument/status_test - B/op |
1305 B/op |
1305 B/op |
1 |
BenchmarkDocument/status_test - allocs/op |
22 allocs/op |
22 allocs/op |
1 |
BenchmarkDocument/equals_test |
7769 ns/op 7273 B/op 132 allocs/op |
7582 ns/op 7273 B/op 132 allocs/op |
1.02 |
BenchmarkDocument/equals_test - ns/op |
7769 ns/op |
7582 ns/op |
1.02 |
BenchmarkDocument/equals_test - B/op |
7273 B/op |
7273 B/op |
1 |
BenchmarkDocument/equals_test - allocs/op |
132 allocs/op |
132 allocs/op |
1 |
BenchmarkDocument/nested_update_test |
17197 ns/op 12139 B/op 262 allocs/op |
16746 ns/op 12139 B/op 262 allocs/op |
1.03 |
BenchmarkDocument/nested_update_test - ns/op |
17197 ns/op |
16746 ns/op |
1.03 |
BenchmarkDocument/nested_update_test - B/op |
12139 B/op |
12139 B/op |
1 |
BenchmarkDocument/nested_update_test - allocs/op |
262 allocs/op |
262 allocs/op |
1 |
BenchmarkDocument/delete_test |
23268 ns/op 15364 B/op 341 allocs/op |
25526 ns/op 15363 B/op 341 allocs/op |
0.91 |
BenchmarkDocument/delete_test - ns/op |
23268 ns/op |
25526 ns/op |
0.91 |
BenchmarkDocument/delete_test - B/op |
15364 B/op |
15363 B/op |
1.00 |
BenchmarkDocument/delete_test - allocs/op |
341 allocs/op |
341 allocs/op |
1 |
BenchmarkDocument/object_test |
8894 ns/op 6817 B/op 120 allocs/op |
8559 ns/op 6817 B/op 120 allocs/op |
1.04 |
BenchmarkDocument/object_test - ns/op |
8894 ns/op |
8559 ns/op |
1.04 |
BenchmarkDocument/object_test - B/op |
6817 B/op |
6817 B/op |
1 |
BenchmarkDocument/object_test - allocs/op |
120 allocs/op |
120 allocs/op |
1 |
BenchmarkDocument/array_test |
30150 ns/op 11947 B/op 276 allocs/op |
29241 ns/op 11947 B/op 276 allocs/op |
1.03 |
BenchmarkDocument/array_test - ns/op |
30150 ns/op |
29241 ns/op |
1.03 |
BenchmarkDocument/array_test - B/op |
11947 B/op |
11947 B/op |
1 |
BenchmarkDocument/array_test - allocs/op |
276 allocs/op |
276 allocs/op |
1 |
BenchmarkDocument/text_test |
37393 ns/op 14716 B/op 469 allocs/op |
30525 ns/op 14716 B/op 469 allocs/op |
1.22 |
BenchmarkDocument/text_test - ns/op |
37393 ns/op |
30525 ns/op |
1.22 |
BenchmarkDocument/text_test - B/op |
14716 B/op |
14716 B/op |
1 |
BenchmarkDocument/text_test - allocs/op |
469 allocs/op |
469 allocs/op |
1 |
BenchmarkDocument/text_composition_test |
29602 ns/op 18423 B/op 484 allocs/op |
28918 ns/op 18420 B/op 484 allocs/op |
1.02 |
BenchmarkDocument/text_composition_test - ns/op |
29602 ns/op |
28918 ns/op |
1.02 |
BenchmarkDocument/text_composition_test - B/op |
18423 B/op |
18420 B/op |
1.00 |
BenchmarkDocument/text_composition_test - allocs/op |
484 allocs/op |
484 allocs/op |
1 |
BenchmarkDocument/rich_text_test |
80761 ns/op 38477 B/op 1148 allocs/op |
80861 ns/op 38477 B/op 1148 allocs/op |
1.00 |
BenchmarkDocument/rich_text_test - ns/op |
80761 ns/op |
80861 ns/op |
1.00 |
BenchmarkDocument/rich_text_test - B/op |
38477 B/op |
38477 B/op |
1 |
BenchmarkDocument/rich_text_test - allocs/op |
1148 allocs/op |
1148 allocs/op |
1 |
BenchmarkDocument/counter_test |
17380 ns/op 10722 B/op 244 allocs/op |
17310 ns/op 10722 B/op 244 allocs/op |
1.00 |
BenchmarkDocument/counter_test - ns/op |
17380 ns/op |
17310 ns/op |
1.00 |
BenchmarkDocument/counter_test - B/op |
10722 B/op |
10722 B/op |
1 |
BenchmarkDocument/counter_test - allocs/op |
244 allocs/op |
244 allocs/op |
1 |
BenchmarkDocument/text_edit_gc_100 |
1292924 ns/op 870956 B/op 16753 allocs/op |
1291389 ns/op 870893 B/op 16752 allocs/op |
1.00 |
BenchmarkDocument/text_edit_gc_100 - ns/op |
1292924 ns/op |
1291389 ns/op |
1.00 |
BenchmarkDocument/text_edit_gc_100 - B/op |
870956 B/op |
870893 B/op |
1.00 |
BenchmarkDocument/text_edit_gc_100 - allocs/op |
16753 allocs/op |
16752 allocs/op |
1.00 |
BenchmarkDocument/text_edit_gc_1000 |
49390487 ns/op 50535992 B/op 181713 allocs/op |
49349802 ns/op 50535739 B/op 181718 allocs/op |
1.00 |
BenchmarkDocument/text_edit_gc_1000 - ns/op |
49390487 ns/op |
49349802 ns/op |
1.00 |
BenchmarkDocument/text_edit_gc_1000 - B/op |
50535992 B/op |
50535739 B/op |
1.00 |
BenchmarkDocument/text_edit_gc_1000 - allocs/op |
181713 allocs/op |
181718 allocs/op |
1.00 |
BenchmarkDocument/text_split_gc_100 |
1901675 ns/op 1528809 B/op 15605 allocs/op |
1892402 ns/op 1528862 B/op 15605 allocs/op |
1.00 |
BenchmarkDocument/text_split_gc_100 - ns/op |
1901675 ns/op |
1892402 ns/op |
1.00 |
BenchmarkDocument/text_split_gc_100 - B/op |
1528809 B/op |
1528862 B/op |
1.00 |
BenchmarkDocument/text_split_gc_100 - allocs/op |
15605 allocs/op |
15605 allocs/op |
1 |
BenchmarkDocument/text_split_gc_1000 |
118868519 ns/op 135077567 B/op 182197 allocs/op |
114040087 ns/op 135078752 B/op 182212 allocs/op |
1.04 |
BenchmarkDocument/text_split_gc_1000 - ns/op |
118868519 ns/op |
114040087 ns/op |
1.04 |
BenchmarkDocument/text_split_gc_1000 - B/op |
135077567 B/op |
135078752 B/op |
1.00 |
BenchmarkDocument/text_split_gc_1000 - allocs/op |
182197 allocs/op |
182212 allocs/op |
1.00 |
BenchmarkDocument/text_delete_all_10000 |
17887887 ns/op 10184372 B/op 40678 allocs/op |
15160707 ns/op 10183869 B/op 40678 allocs/op |
1.18 |
BenchmarkDocument/text_delete_all_10000 - ns/op |
17887887 ns/op |
15160707 ns/op |
1.18 |
BenchmarkDocument/text_delete_all_10000 - B/op |
10184372 B/op |
10183869 B/op |
1.00 |
BenchmarkDocument/text_delete_all_10000 - allocs/op |
40678 allocs/op |
40678 allocs/op |
1 |
BenchmarkDocument/text_delete_all_100000 |
298015764 ns/op 142680648 B/op 411729 allocs/op |
284049852 ns/op 142673108 B/op 411704 allocs/op |
1.05 |
BenchmarkDocument/text_delete_all_100000 - ns/op |
298015764 ns/op |
284049852 ns/op |
1.05 |
BenchmarkDocument/text_delete_all_100000 - B/op |
142680648 B/op |
142673108 B/op |
1.00 |
BenchmarkDocument/text_delete_all_100000 - allocs/op |
411729 allocs/op |
411704 allocs/op |
1.00 |
BenchmarkDocument/text_100 |
215706 ns/op 120037 B/op 5081 allocs/op |
218418 ns/op 120037 B/op 5081 allocs/op |
0.99 |
BenchmarkDocument/text_100 - ns/op |
215706 ns/op |
218418 ns/op |
0.99 |
BenchmarkDocument/text_100 - B/op |
120037 B/op |
120037 B/op |
1 |
BenchmarkDocument/text_100 - allocs/op |
5081 allocs/op |
5081 allocs/op |
1 |
BenchmarkDocument/text_1000 |
2333291 ns/op 1169022 B/op 50085 allocs/op |
2356274 ns/op 1169039 B/op 50085 allocs/op |
0.99 |
BenchmarkDocument/text_1000 - ns/op |
2333291 ns/op |
2356274 ns/op |
0.99 |
BenchmarkDocument/text_1000 - B/op |
1169022 B/op |
1169039 B/op |
1.00 |
BenchmarkDocument/text_1000 - allocs/op |
50085 allocs/op |
50085 allocs/op |
1 |
BenchmarkDocument/array_1000 |
1202867 ns/op 1091309 B/op 11831 allocs/op |
1204559 ns/op 1091408 B/op 11832 allocs/op |
1.00 |
BenchmarkDocument/array_1000 - ns/op |
1202867 ns/op |
1204559 ns/op |
1.00 |
BenchmarkDocument/array_1000 - B/op |
1091309 B/op |
1091408 B/op |
1.00 |
BenchmarkDocument/array_1000 - allocs/op |
11831 allocs/op |
11832 allocs/op |
1.00 |
BenchmarkDocument/array_10000 |
13315377 ns/op 9800426 B/op 120299 allocs/op |
13085982 ns/op 9800219 B/op 120296 allocs/op |
1.02 |
BenchmarkDocument/array_10000 - ns/op |
13315377 ns/op |
13085982 ns/op |
1.02 |
BenchmarkDocument/array_10000 - B/op |
9800426 B/op |
9800219 B/op |
1.00 |
BenchmarkDocument/array_10000 - allocs/op |
120299 allocs/op |
120296 allocs/op |
1.00 |
BenchmarkDocument/array_gc_100 |
144246 ns/op 132727 B/op 1261 allocs/op |
151514 ns/op 132714 B/op 1260 allocs/op |
0.95 |
BenchmarkDocument/array_gc_100 - ns/op |
144246 ns/op |
151514 ns/op |
0.95 |
BenchmarkDocument/array_gc_100 - B/op |
132727 B/op |
132714 B/op |
1.00 |
BenchmarkDocument/array_gc_100 - allocs/op |
1261 allocs/op |
1260 allocs/op |
1.00 |
BenchmarkDocument/array_gc_1000 |
1381206 ns/op 1159163 B/op 12877 allocs/op |
1410082 ns/op 1159154 B/op 12876 allocs/op |
0.98 |
BenchmarkDocument/array_gc_1000 - ns/op |
1381206 ns/op |
1410082 ns/op |
0.98 |
BenchmarkDocument/array_gc_1000 - B/op |
1159163 B/op |
1159154 B/op |
1.00 |
BenchmarkDocument/array_gc_1000 - allocs/op |
12877 allocs/op |
12876 allocs/op |
1.00 |
BenchmarkDocument/counter_1000 |
196817 ns/op 193079 B/op 5771 allocs/op |
204377 ns/op 193081 B/op 5771 allocs/op |
0.96 |
BenchmarkDocument/counter_1000 - ns/op |
196817 ns/op |
204377 ns/op |
0.96 |
BenchmarkDocument/counter_1000 - B/op |
193079 B/op |
193081 B/op |
1.00 |
BenchmarkDocument/counter_1000 - allocs/op |
5771 allocs/op |
5771 allocs/op |
1 |
BenchmarkDocument/counter_10000 |
2237441 ns/op 2087997 B/op 59778 allocs/op |
2164024 ns/op 2088011 B/op 59778 allocs/op |
1.03 |
BenchmarkDocument/counter_10000 - ns/op |
2237441 ns/op |
2164024 ns/op |
1.03 |
BenchmarkDocument/counter_10000 - B/op |
2087997 B/op |
2088011 B/op |
1.00 |
BenchmarkDocument/counter_10000 - allocs/op |
59778 allocs/op |
59778 allocs/op |
1 |
BenchmarkDocument/object_1000 |
1351808 ns/op 1428275 B/op 9849 allocs/op |
1382662 ns/op 1428255 B/op 9849 allocs/op |
0.98 |
BenchmarkDocument/object_1000 - ns/op |
1351808 ns/op |
1382662 ns/op |
0.98 |
BenchmarkDocument/object_1000 - B/op |
1428275 B/op |
1428255 B/op |
1.00 |
BenchmarkDocument/object_1000 - allocs/op |
9849 allocs/op |
9849 allocs/op |
1 |
BenchmarkDocument/object_10000 |
15465446 ns/op 12166762 B/op 100563 allocs/op |
14923260 ns/op 12167228 B/op 100567 allocs/op |
1.04 |
BenchmarkDocument/object_10000 - ns/op |
15465446 ns/op |
14923260 ns/op |
1.04 |
BenchmarkDocument/object_10000 - B/op |
12166762 B/op |
12167228 B/op |
1.00 |
BenchmarkDocument/object_10000 - allocs/op |
100563 allocs/op |
100567 allocs/op |
1.00 |
BenchmarkDocument/tree_100 |
1051841 ns/op 943702 B/op 6101 allocs/op |
1006159 ns/op 943707 B/op 6101 allocs/op |
1.05 |
BenchmarkDocument/tree_100 - ns/op |
1051841 ns/op |
1006159 ns/op |
1.05 |
BenchmarkDocument/tree_100 - B/op |
943702 B/op |
943707 B/op |
1.00 |
BenchmarkDocument/tree_100 - allocs/op |
6101 allocs/op |
6101 allocs/op |
1 |
BenchmarkDocument/tree_1000 |
78034295 ns/op 86460446 B/op 60115 allocs/op |
72281231 ns/op 86460229 B/op 60115 allocs/op |
1.08 |
BenchmarkDocument/tree_1000 - ns/op |
78034295 ns/op |
72281231 ns/op |
1.08 |
BenchmarkDocument/tree_1000 - B/op |
86460446 B/op |
86460229 B/op |
1.00 |
BenchmarkDocument/tree_1000 - allocs/op |
60115 allocs/op |
60115 allocs/op |
1 |
BenchmarkDocument/tree_10000 |
9365401499 ns/op 8580662768 B/op 600230 allocs/op |
9365945451 ns/op 8580657456 B/op 600248 allocs/op |
1.00 |
BenchmarkDocument/tree_10000 - ns/op |
9365401499 ns/op |
9365945451 ns/op |
1.00 |
BenchmarkDocument/tree_10000 - B/op |
8580662768 B/op |
8580657456 B/op |
1.00 |
BenchmarkDocument/tree_10000 - allocs/op |
600230 allocs/op |
600248 allocs/op |
1.00 |
BenchmarkDocument/tree_delete_all_1000 |
73677751 ns/op 87531786 B/op 75268 allocs/op |
73743668 ns/op 87531618 B/op 75265 allocs/op |
1.00 |
BenchmarkDocument/tree_delete_all_1000 - ns/op |
73677751 ns/op |
73743668 ns/op |
1.00 |
BenchmarkDocument/tree_delete_all_1000 - B/op |
87531786 B/op |
87531618 B/op |
1.00 |
BenchmarkDocument/tree_delete_all_1000 - allocs/op |
75268 allocs/op |
75265 allocs/op |
1.00 |
BenchmarkDocument/tree_edit_gc_100 |
3677092 ns/op 4146673 B/op 15140 allocs/op |
3688002 ns/op 4146676 B/op 15140 allocs/op |
1.00 |
BenchmarkDocument/tree_edit_gc_100 - ns/op |
3677092 ns/op |
3688002 ns/op |
1.00 |
BenchmarkDocument/tree_edit_gc_100 - B/op |
4146673 B/op |
4146676 B/op |
1.00 |
BenchmarkDocument/tree_edit_gc_100 - allocs/op |
15140 allocs/op |
15140 allocs/op |
1 |
BenchmarkDocument/tree_edit_gc_1000 |
293155692 ns/op 383744268 B/op 154842 allocs/op |
293568102 ns/op 383741652 B/op 154843 allocs/op |
1.00 |
BenchmarkDocument/tree_edit_gc_1000 - ns/op |
293155692 ns/op |
293568102 ns/op |
1.00 |
BenchmarkDocument/tree_edit_gc_1000 - B/op |
383744268 B/op |
383741652 B/op |
1.00 |
BenchmarkDocument/tree_edit_gc_1000 - allocs/op |
154842 allocs/op |
154843 allocs/op |
1.00 |
BenchmarkDocument/tree_split_gc_100 |
2486814 ns/op 2412539 B/op 11125 allocs/op |
2475105 ns/op 2412470 B/op 11125 allocs/op |
1.00 |
BenchmarkDocument/tree_split_gc_100 - ns/op |
2486814 ns/op |
2475105 ns/op |
1.00 |
BenchmarkDocument/tree_split_gc_100 - B/op |
2412539 B/op |
2412470 B/op |
1.00 |
BenchmarkDocument/tree_split_gc_100 - allocs/op |
11125 allocs/op |
11125 allocs/op |
1 |
BenchmarkDocument/tree_split_gc_1000 |
179047489 ns/op 222251708 B/op 121988 allocs/op |
177667172 ns/op 222252884 B/op 121995 allocs/op |
1.01 |
BenchmarkDocument/tree_split_gc_1000 - ns/op |
179047489 ns/op |
177667172 ns/op |
1.01 |
BenchmarkDocument/tree_split_gc_1000 - B/op |
222251708 B/op |
222252884 B/op |
1.00 |
BenchmarkDocument/tree_split_gc_1000 - allocs/op |
121988 allocs/op |
121995 allocs/op |
1.00 |
BenchmarkRPC/client_to_server |
391010242 ns/op 16961501 B/op 175385 allocs/op |
378271463 ns/op 17505365 B/op 175393 allocs/op |
1.03 |
BenchmarkRPC/client_to_server - ns/op |
391010242 ns/op |
378271463 ns/op |
1.03 |
BenchmarkRPC/client_to_server - B/op |
16961501 B/op |
17505365 B/op |
0.97 |
BenchmarkRPC/client_to_server - allocs/op |
175385 allocs/op |
175393 allocs/op |
1.00 |
BenchmarkRPC/client_to_client_via_server |
646760026 ns/op 32255612 B/op 321504 allocs/op |
630567744 ns/op 32195496 B/op 321046 allocs/op |
1.03 |
BenchmarkRPC/client_to_client_via_server - ns/op |
646760026 ns/op |
630567744 ns/op |
1.03 |
BenchmarkRPC/client_to_client_via_server - B/op |
32255612 B/op |
32195496 B/op |
1.00 |
BenchmarkRPC/client_to_client_via_server - allocs/op |
321504 allocs/op |
321046 allocs/op |
1.00 |
BenchmarkRPC/attach_large_document |
1642153107 ns/op 1896315608 B/op 8917 allocs/op |
1323421325 ns/op 1895489928 B/op 8794 allocs/op |
1.24 |
BenchmarkRPC/attach_large_document - ns/op |
1642153107 ns/op |
1323421325 ns/op |
1.24 |
BenchmarkRPC/attach_large_document - B/op |
1896315608 B/op |
1895489928 B/op |
1.00 |
BenchmarkRPC/attach_large_document - allocs/op |
8917 allocs/op |
8794 allocs/op |
1.01 |
BenchmarkRPC/adminCli_to_server |
551906985 ns/op 35961148 B/op 289548 allocs/op |
548042978 ns/op 36775224 B/op 289567 allocs/op |
1.01 |
BenchmarkRPC/adminCli_to_server - ns/op |
551906985 ns/op |
548042978 ns/op |
1.01 |
BenchmarkRPC/adminCli_to_server - B/op |
35961148 B/op |
36775224 B/op |
0.98 |
BenchmarkRPC/adminCli_to_server - allocs/op |
289548 allocs/op |
289567 allocs/op |
1.00 |
BenchmarkLocker |
64.18 ns/op 16 B/op 1 allocs/op |
64.3 ns/op 16 B/op 1 allocs/op |
1.00 |
BenchmarkLocker - ns/op |
64.18 ns/op |
64.3 ns/op |
1.00 |
BenchmarkLocker - B/op |
16 B/op |
16 B/op |
1 |
BenchmarkLocker - allocs/op |
1 allocs/op |
1 allocs/op |
1 |
BenchmarkLockerParallel |
38.31 ns/op 0 B/op 0 allocs/op |
39.15 ns/op 0 B/op 0 allocs/op |
0.98 |
BenchmarkLockerParallel - ns/op |
38.31 ns/op |
39.15 ns/op |
0.98 |
BenchmarkLockerParallel - B/op |
0 B/op |
0 B/op |
1 |
BenchmarkLockerParallel - allocs/op |
0 allocs/op |
0 allocs/op |
1 |
BenchmarkLockerMoreKeys |
143.9 ns/op 15 B/op 0 allocs/op |
144.8 ns/op 15 B/op 0 allocs/op |
0.99 |
BenchmarkLockerMoreKeys - ns/op |
143.9 ns/op |
144.8 ns/op |
0.99 |
BenchmarkLockerMoreKeys - B/op |
15 B/op |
15 B/op |
1 |
BenchmarkLockerMoreKeys - allocs/op |
0 allocs/op |
0 allocs/op |
1 |
BenchmarkChange/Push_10_Changes |
3931072 ns/op 121460 B/op 1284 allocs/op |
3905324 ns/op 121283 B/op 1284 allocs/op |
1.01 |
BenchmarkChange/Push_10_Changes - ns/op |
3931072 ns/op |
3905324 ns/op |
1.01 |
BenchmarkChange/Push_10_Changes - B/op |
121460 B/op |
121283 B/op |
1.00 |
BenchmarkChange/Push_10_Changes - allocs/op |
1284 allocs/op |
1284 allocs/op |
1 |
BenchmarkChange/Push_100_Changes |
14841713 ns/op 569010 B/op 6655 allocs/op |
14573165 ns/op 573211 B/op 6655 allocs/op |
1.02 |
BenchmarkChange/Push_100_Changes - ns/op |
14841713 ns/op |
14573165 ns/op |
1.02 |
BenchmarkChange/Push_100_Changes - B/op |
569010 B/op |
573211 B/op |
0.99 |
BenchmarkChange/Push_100_Changes - allocs/op |
6655 allocs/op |
6655 allocs/op |
1 |
BenchmarkChange/Push_1000_Changes |
119381529 ns/op 5287576 B/op 63152 allocs/op |
117467772 ns/op 5301204 B/op 63152 allocs/op |
1.02 |
BenchmarkChange/Push_1000_Changes - ns/op |
119381529 ns/op |
117467772 ns/op |
1.02 |
BenchmarkChange/Push_1000_Changes - B/op |
5287576 B/op |
5301204 B/op |
1.00 |
BenchmarkChange/Push_1000_Changes - allocs/op |
63152 allocs/op |
63152 allocs/op |
1 |
BenchmarkChange/Pull_10_Changes |
3000620 ns/op 99786 B/op 1005 allocs/op |
2911234 ns/op 100805 B/op 1004 allocs/op |
1.03 |
BenchmarkChange/Pull_10_Changes - ns/op |
3000620 ns/op |
2911234 ns/op |
1.03 |
BenchmarkChange/Pull_10_Changes - B/op |
99786 B/op |
100805 B/op |
0.99 |
BenchmarkChange/Pull_10_Changes - allocs/op |
1005 allocs/op |
1004 allocs/op |
1.00 |
BenchmarkChange/Pull_100_Changes |
4348567 ns/op 263834 B/op 3476 allocs/op |
4337477 ns/op 266331 B/op 3475 allocs/op |
1.00 |
BenchmarkChange/Pull_100_Changes - ns/op |
4348567 ns/op |
4337477 ns/op |
1.00 |
BenchmarkChange/Pull_100_Changes - B/op |
263834 B/op |
266331 B/op |
0.99 |
BenchmarkChange/Pull_100_Changes - allocs/op |
3476 allocs/op |
3475 allocs/op |
1.00 |
BenchmarkChange/Pull_1000_Changes |
8537287 ns/op 1491577 B/op 29861 allocs/op |
8599897 ns/op 1493714 B/op 29861 allocs/op |
0.99 |
BenchmarkChange/Pull_1000_Changes - ns/op |
8537287 ns/op |
8599897 ns/op |
0.99 |
BenchmarkChange/Pull_1000_Changes - B/op |
1491577 B/op |
1493714 B/op |
1.00 |
BenchmarkChange/Pull_1000_Changes - allocs/op |
29861 allocs/op |
29861 allocs/op |
1 |
BenchmarkSnapshot/Push_3KB_snapshot |
17103535 ns/op 701842 B/op 6655 allocs/op |
16859798 ns/op 715740 B/op 6655 allocs/op |
1.01 |
BenchmarkSnapshot/Push_3KB_snapshot - ns/op |
17103535 ns/op |
16859798 ns/op |
1.01 |
BenchmarkSnapshot/Push_3KB_snapshot - B/op |
701842 B/op |
715740 B/op |
0.98 |
BenchmarkSnapshot/Push_3KB_snapshot - allocs/op |
6655 allocs/op |
6655 allocs/op |
1 |
BenchmarkSnapshot/Push_30KB_snapshot |
120625677 ns/op 5611046 B/op 63157 allocs/op |
120365053 ns/op 5656010 B/op 63159 allocs/op |
1.00 |
BenchmarkSnapshot/Push_30KB_snapshot - ns/op |
120625677 ns/op |
120365053 ns/op |
1.00 |
BenchmarkSnapshot/Push_30KB_snapshot - B/op |
5611046 B/op |
5656010 B/op |
0.99 |
BenchmarkSnapshot/Push_30KB_snapshot - allocs/op |
63157 allocs/op |
63159 allocs/op |
1.00 |
BenchmarkSnapshot/Pull_3KB_snapshot |
6437008 ns/op 919903 B/op 15513 allocs/op |
6429820 ns/op 923248 B/op 15512 allocs/op |
1.00 |
BenchmarkSnapshot/Pull_3KB_snapshot - ns/op |
6437008 ns/op |
6429820 ns/op |
1.00 |
BenchmarkSnapshot/Pull_3KB_snapshot - B/op |
919903 B/op |
923248 B/op |
1.00 |
BenchmarkSnapshot/Pull_3KB_snapshot - allocs/op |
15513 allocs/op |
15512 allocs/op |
1.00 |
BenchmarkSnapshot/Pull_30KB_snapshot |
15215817 ns/op 7155918 B/op 150106 allocs/op |
14954068 ns/op 7158788 B/op 150106 allocs/op |
1.02 |
BenchmarkSnapshot/Pull_30KB_snapshot - ns/op |
15215817 ns/op |
14954068 ns/op |
1.02 |
BenchmarkSnapshot/Pull_30KB_snapshot - B/op |
7155918 B/op |
7158788 B/op |
1.00 |
BenchmarkSnapshot/Pull_30KB_snapshot - allocs/op |
150106 allocs/op |
150106 allocs/op |
1 |
BenchmarkSync/memory_sync_10_test |
6861 ns/op 1286 B/op 38 allocs/op |
7088 ns/op 1286 B/op 38 allocs/op |
0.97 |
BenchmarkSync/memory_sync_10_test - ns/op |
6861 ns/op |
7088 ns/op |
0.97 |
BenchmarkSync/memory_sync_10_test - B/op |
1286 B/op |
1286 B/op |
1 |
BenchmarkSync/memory_sync_10_test - allocs/op |
38 allocs/op |
38 allocs/op |
1 |
BenchmarkSync/memory_sync_100_test |
51796 ns/op 8634 B/op 273 allocs/op |
57165 ns/op 8987 B/op 295 allocs/op |
0.91 |
BenchmarkSync/memory_sync_100_test - ns/op |
51796 ns/op |
57165 ns/op |
0.91 |
BenchmarkSync/memory_sync_100_test - B/op |
8634 B/op |
8987 B/op |
0.96 |
BenchmarkSync/memory_sync_100_test - allocs/op |
273 allocs/op |
295 allocs/op |
0.93 |
BenchmarkSync/memory_sync_1000_test |
578102 ns/op 75407 B/op 2187 allocs/op |
427611 ns/op 82546 B/op 2633 allocs/op |
1.35 |
BenchmarkSync/memory_sync_1000_test - ns/op |
578102 ns/op |
427611 ns/op |
1.35 |
BenchmarkSync/memory_sync_1000_test - B/op |
75407 B/op |
82546 B/op |
0.91 |
BenchmarkSync/memory_sync_1000_test - allocs/op |
2187 allocs/op |
2633 allocs/op |
0.83 |
BenchmarkSync/memory_sync_10000_test |
7377477 ns/op 736606 B/op 20270 allocs/op |
4259129 ns/op 797496 B/op 23871 allocs/op |
1.73 |
BenchmarkSync/memory_sync_10000_test - ns/op |
7377477 ns/op |
4259129 ns/op |
1.73 |
BenchmarkSync/memory_sync_10000_test - B/op |
736606 B/op |
797496 B/op |
0.92 |
BenchmarkSync/memory_sync_10000_test - allocs/op |
20270 allocs/op |
23871 allocs/op |
0.85 |
BenchmarkTextEditing |
5383473921 ns/op 3901933848 B/op 18743528 allocs/op |
4894568392 ns/op 3901992032 B/op 18743630 allocs/op |
1.10 |
BenchmarkTextEditing - ns/op |
5383473921 ns/op |
4894568392 ns/op |
1.10 |
BenchmarkTextEditing - B/op |
3901933848 B/op |
3901992032 B/op |
1.00 |
BenchmarkTextEditing - allocs/op |
18743528 allocs/op |
18743630 allocs/op |
1.00 |
This comment was automatically generated by workflow using github-action-benchmark.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- server/rpc/connecthelper/status.go (5 hunks)
Files skipped from review as they are similar to previous changes (1)
- server/rpc/connecthelper/status.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- server/rpc/yorkie_server.go (2 hunks)
Additional comments not posted (1)
server/rpc/yorkie_server.go (1)
389-395
: LGTM! Ensure correctness of the conditional check.The added conditional check before locating active client information enhances error handling.
However, verify that this change correctly handles all edge cases and does not introduce any new issues.
What this PR does / why we need it:
Provide error codes for enhancing error handling from clients
Previously, server sends
connect.Code
to clients to indicate error code,such as
FailedPrecondition
, in a simplistic manner. This makes itchallenging for clients to differentiate and handle individual
situations effectively.
This commit provides error detailed codes as metadata for enhancing error
handling from clients.
Which issue(s) this PR fixes:
Addresses #922
Special notes for your reviewer:
Does this PR introduce a user-facing change?:
Additional documentation:
Checklist:
Summary by CodeRabbit
New Features
Bug Fixes
Refactor