Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Goshimmer_without_tipselection
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
COLLET Ismael
Goshimmer_without_tipselection
Commits
ef89a201
Unverified
Commit
ef89a201
authored
4 years ago
by
Luca Moser
Committed by
GitHub
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
fixes comm-layer msg loss (#459)
parent
954b4bb6
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/binary/messagelayer/tangle/tangle.go
+9
-0
9 additions, 0 deletions
packages/binary/messagelayer/tangle/tangle.go
plugins/messagelayer/plugin.go
+1
-0
1 addition, 0 deletions
plugins/messagelayer/plugin.go
with
10 additions
and
0 deletions
packages/binary/messagelayer/tangle/tangle.go
+
9
−
0
View file @
ef89a201
...
...
@@ -274,16 +274,25 @@ func (tangle *Tangle) MonitorMissingMessages(shutdownSignal <-chan struct{}) {
select
{
case
<-
reCheckInterval
.
C
:
var
toDelete
[]
message
.
Id
var
toUnmark
[]
message
.
Id
tangle
.
missingMessageStorage
.
ForEach
(
func
(
key
[]
byte
,
cachedObject
objectstorage
.
CachedObject
)
bool
{
defer
cachedObject
.
Release
()
missingMessage
:=
cachedObject
.
Get
()
.
(
*
MissingMessage
)
if
tangle
.
messageStorage
.
Contains
(
missingMessage
.
messageId
.
Bytes
())
{
toUnmark
=
append
(
toUnmark
,
missingMessage
.
MessageId
())
return
true
}
// check whether message is missing since over our max time delta
if
time
.
Since
(
missingMessage
.
MissingSince
())
>=
MaxMissingTimeBeforeCleanup
{
toDelete
=
append
(
toDelete
,
missingMessage
.
MessageId
())
}
return
true
})
for
_
,
msgID
:=
range
toUnmark
{
tangle
.
missingMessageStorage
.
DeleteIfPresent
(
msgID
.
Bytes
())
}
for
_
,
msgID
:=
range
toDelete
{
// delete the future cone of the missing message
tangle
.
Events
.
MessageUnsolidifiable
.
Trigger
(
msgID
)
...
...
This diff is collapsed.
Click to expand it.
plugins/messagelayer/plugin.go
+
1
−
0
View file @
ef89a201
...
...
@@ -73,6 +73,7 @@ func configure(*node.Plugin) {
}
func
run
(
*
node
.
Plugin
)
{
if
err
:=
daemon
.
BackgroundWorker
(
"Tangle[MissingMessagesMonitor]"
,
func
(
shutdownSignal
<-
chan
struct
{})
{
Tangle
.
MonitorMissingMessages
(
shutdownSignal
)
},
shutdown
.
PriorityMissingMessagesMonitoring
);
err
!=
nil
{
...
...
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