Skip to content

[TH2-1686] Use a common executor for running check rules#142

Open
OptimumCode wants to merge 11 commits intodevfrom
th2-1686-op1
Open

[TH2-1686] Use a common executor for running check rules#142
OptimumCode wants to merge 11 commits intodevfrom
th2-1686-op1

Conversation

@OptimumCode
Copy link
Copy Markdown
Contributor

No description provided.

cordwelt
cordwelt previously approved these changes Apr 29, 2022
cordwelt
cordwelt previously approved these changes Feb 2, 2023
Comment on lines +352 to +357
bodyData(createMessageBean("The rule starts working from " +
(if (lastSequence == DEFAULT_SEQUENCE) "start of cache" else "sequence $lastSequence") +
(checkpointTimestamp?.let {
val instant = checkpointTimestamp.toInstant()
" and expects messages between $instant and ${instant.plusMillis(taskTimeout.messageTimeout)}"
} ?: "")))
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(if (lastSequence == DEFAULT_SEQUENCE) "start of cache" else "sequence $lastSequence") +
(checkpointTimestamp?.let {
    val instant = checkpointTimestamp.toInstant()
    " and expects messages between $instant and ${instant.plusMillis(taskTimeout.messageTimeout)}"
} ?: "")

May be build it using buildString instead?

Comment on lines +531 to +537
private fun messageTimeoutText(): String = "Check task was interrupted because the timestamp on the last processed message exceeds the message timeout. " +
(checkpointTimeout
?.toInstant()
?.let {
"Rule expects messages between $it and ${it.plusMillis(taskTimeout.messageTimeout)} " +
"but processed one outside this range. Check the messages attached to the root rule event to find all processed messages."
} ?: "But the message timeout is not specified. Contact the developers.")
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here

!Drop this commit when rebasing on dev branch!
!task.hasNextRule().also { canBeRemoved ->
when {
canBeRemoved -> logger.info("Removed task ${task.description} ($endTime) from tasks map")
else -> logger.warn("Task ${task.description} can't be removed because it has a continuation")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this case warn? Maybe use debug log level for logging

@@ -0,0 +1,26 @@
/*
* Copyright 2022 Exactpro (Exactpro Systems Limited)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Copyright 2022 Exactpro (Exactpro Systems Limited)
* Copyright 2023 Exactpro (Exactpro Systems Limited)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants