Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
picodata
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
core
picodata
Commits
98b885fd
Commit
98b885fd
authored
1 year ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
fix: used to hold non-yield-safe references across yields
parent
6d0e159b
No related branches found
Branches containing commit
No related tags found
4 merge requests
!807
Draft: fix: remove deprecated message for install nodejs
,
!794
Gmoshkin/reachability manager yield safety
,
!778
sbroad: refactoring of the table constructor API
,
!757
fix: more patches for gamayun
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/traft/network.rs
+3
-3
3 additions, 3 deletions
src/traft/network.rs
src/traft/node.rs
+6
-6
6 additions, 6 deletions
src/traft/node.rs
with
9 additions
and
9 deletions
src/traft/network.rs
+
3
−
3
View file @
98b885fd
...
...
@@ -224,8 +224,6 @@ impl PoolWorker {
poll_fn
(|
cx
|
{
let
mut
has_ready
:
bool
=
false
;
let
mut
cursor
=
0
;
// NOTE: must not yield until this is dropped.
let
mut
reachability
=
instance_reachability
.borrow_mut
();
while
cursor
<
futures
.len
()
{
let
poll_result
=
Future
::
poll
(
futures
[
cursor
]
.2
.as_mut
(),
cx
);
if
let
Poll
::
Ready
(
result
)
=
poll_result
{
...
...
@@ -260,7 +258,9 @@ impl PoolWorker {
|
TOError
::
Failed
(
NetError
::
Io
(
_
))
);
}
reachability
.report_result
(
raft_id
,
success
);
instance_reachability
.borrow_mut
()
.report_result
(
raft_id
,
success
);
}
}
has_ready
=
true
;
...
...
This diff is collapsed.
Click to expand it.
src/traft/node.rs
+
6
−
6
View file @
98b885fd
...
...
@@ -1403,13 +1403,13 @@ impl NodeImpl {
let
mut
sent_count
=
0
;
let
mut
skip_count
=
0
;
let
instance_reachability
=
self
.instance_reachability
.borrow
();
for
msg
in
messages
{
if
msg
.msg_type
==
raft
::
MessageType
::
MsgHeartbeat
&&
!
instance_reachability
.should_send_heartbeat_this_tick
(
msg
.to
)
{
skip_count
+=
1
;
continue
;
if
msg
.msg_type
==
raft
::
MessageType
::
MsgHeartbeat
{
let
instance_reachability
=
self
.instance_reachability
.borrow
();
if
!
instance_reachability
.should_send_heartbeat_this_tick
(
msg
.to
)
{
skip_count
+=
1
;
continue
;
}
}
sent_count
+=
1
;
if
let
Err
(
e
)
=
self
.pool
.send
(
msg
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment