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
88ce129e
Commit
88ce129e
authored
2 years ago
by
Georgy Moshkin
Browse files
Options
Downloads
Patches
Plain Diff
fix(network): fail early when peer address isn't found
parent
327e45a2
No related branches found
No related tags found
1 merge request
!389
Refactor/storage/peer addresses
Pipeline
#13835
passed
2 years ago
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/traft/network.rs
+12
-5
12 additions, 5 deletions
src/traft/network.rs
with
12 additions
and
5 deletions
src/traft/network.rs
+
12
−
5
View file @
88ce129e
...
...
@@ -404,7 +404,12 @@ impl ConnectionPool {
let
instance_id
=
self
.peers
.peer_field
::
<
peer_field
::
InstanceId
>
(
&
raft_id
)
.map_err
(|
_
|
Error
::
NoPeerWithRaftId
(
raft_id
))
.ok
();
.map_err
(|
_
|
Error
::
NoPeerWithRaftId
(
raft_id
))
.ok
();
// Check if address of this peer is known.
// No need to store the result,
// because it will be updated in the loop
let
_
=
self
.peer_addresses
.try_get
(
raft_id
)
?
;
let
worker
=
PoolWorker
::
run
(
raft_id
,
instance_id
.clone
(),
...
...
@@ -614,10 +619,12 @@ inventory::submit!(crate::InnerTest {
);
// Assert unknown recepient error
assert!
(
matches!
(
pool
.send
(
heartbeat_to_from
(
9999
,
3
))
.unwrap_err
(),
Error
::
NoPeerWithRaftId
(
9999
)
));
assert_eq!
(
pool
.send
(
heartbeat_to_from
(
9999
,
3
))
.unwrap_err
()
.to_string
(),
"address of peer with id 9999 not found"
,
);
// Set up on_disconnect trigger
let
on_disconnect_cond
=
Rc
::
new
(
fiber
::
Cond
::
new
());
...
...
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