Skip to content
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

CORE-18981 Add configuration to disable session heartbeats #5384

Merged
merged 28 commits into from
Jan 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
a623177
add config to switch off heartbeats
charlieR3 Jan 5, 2024
7d01b1b
fix integration test
charlieR3 Jan 5, 2024
c611f61
fix integration test
charlieR3 Jan 8, 2024
09082fa
refactor
charlieR3 Jan 8, 2024
99a1051
refactor
charlieR3 Jan 8, 2024
a9ca0e2
refactor
charlieR3 Jan 8, 2024
9646a8c
refactor
charlieR3 Jan 8, 2024
18b294f
Merge branch 'release/os/5.2' into charlie/CORE-18981
charlieR3 Jan 8, 2024
045b8c5
bump api and temp logging
charlieR3 Jan 8, 2024
0eb7c52
hardcode new config for quick test
charlieR3 Jan 9, 2024
cd36fe1
remove random char missed in last commit
charlieR3 Jan 9, 2024
74681a4
fix bug in logic
charlieR3 Jan 10, 2024
2af8f71
hardcode heartbeats enabled
charlieR3 Jan 10, 2024
ac0edba
remove hardcoding
charlieR3 Jan 10, 2024
0b14926
tidy up metrics and add logging to debug
charlieR3 Jan 11, 2024
37cb0b0
clear tracked outbound sessions when new config is received
charlieR3 Jan 11, 2024
6740d80
undo last change and protect against sending heartbeats after config …
charlieR3 Jan 11, 2024
ff9a980
ensure session manager handles changed config
charlieR3 Jan 12, 2024
30114e2
unit tests
charlieR3 Jan 15, 2024
95590b9
Merge branch 'release/os/5.2' into charlie/CORE-18981
charlieR3 Jan 16, 2024
ed747a2
detekt
charlieR3 Jan 16, 2024
18d6a98
reverting log level back to original trace level
charlieR3 Jan 16, 2024
4b28ff4
Merge branch 'release/os/5.2' into charlie/CORE-18981
charlieR3 Jan 16, 2024
bf2f5ee
set latest API version
charlieR3 Jan 16, 2024
2617d6e
revert additional bug fix
charlieR3 Jan 16, 2024
49d8184
PR feedback
charlieR3 Jan 16, 2024
77eeaa3
set API version
charlieR3 Jan 17, 2024
701ccf0
Merge branch 'release/os/5.2' into charlie/CORE-18981
charlieR3 Jan 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import net.corda.data.p2p.crypto.protocol.RevocationCheckMode
import net.corda.db.messagebus.testkit.DBSetup
import net.corda.libs.configuration.SmartConfigFactory
import net.corda.libs.configuration.schema.p2p.LinkManagerConfiguration
import net.corda.libs.configuration.schema.p2p.LinkManagerConfiguration.Companion.HEARTBEAT_ENABLED_KEY
import net.corda.libs.configuration.schema.p2p.LinkManagerConfiguration.Companion.HEARTBEAT_MESSAGE_PERIOD_KEY
import net.corda.libs.configuration.schema.p2p.LinkManagerConfiguration.Companion.MAX_MESSAGE_SIZE_KEY
import net.corda.libs.configuration.schema.p2p.LinkManagerConfiguration.Companion.MAX_REPLAYING_MESSAGES_PER_PEER
Expand Down Expand Up @@ -113,6 +114,7 @@ class LinkManagerIntegrationTest {
return ConfigFactory.empty()
.withValue(MAX_MESSAGE_SIZE_KEY, ConfigValueFactory.fromAnyRef(1000000))
.withValue(MAX_REPLAYING_MESSAGES_PER_PEER, ConfigValueFactory.fromAnyRef(100))
.withValue(HEARTBEAT_ENABLED_KEY, ConfigValueFactory.fromAnyRef(true))
.withValue(HEARTBEAT_MESSAGE_PERIOD_KEY, ConfigValueFactory.fromAnyRef(2000))
.withValue(SESSION_TIMEOUT_KEY, ConfigValueFactory.fromAnyRef(10000))
.withValue(SESSIONS_PER_PEER_KEY, ConfigValueFactory.fromAnyRef(null))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,4 +86,20 @@ private fun recordInboundMessagesMetric(source: String?, dest: String?, group: S
builder.withTag(it.first, value)
}
builder.build().increment()
}

fun recordOutboundSessionTimeoutMetric(source: HoldingIdentity, destination: HoldingIdentity) {
CordaMetrics.Metric.OutboundSessionTimeoutCount.builder()
.withTag(CordaMetrics.Tag.SourceVirtualNode, source.x500Name.toString())
.withTag(CordaMetrics.Tag.DestinationVirtualNode, destination.x500Name.toString())
.withTag(CordaMetrics.Tag.MembershipGroup, source.groupId)
.build().increment()
}

fun recordInboundSessionTimeoutMetric(source: HoldingIdentity, destination: HoldingIdentity?) {
CordaMetrics.Metric.InboundSessionTimeoutCount.builder()
.withTag(CordaMetrics.Tag.SourceVirtualNode, source.x500Name.toString())
.withTag(CordaMetrics.Tag.DestinationVirtualNode, destination?.x500Name?.toString() ?: NOT_APPLICABLE_TAG_VALUE)
.withTag(CordaMetrics.Tag.MembershipGroup, source.groupId)
.build().increment()
}
Loading