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

Fix rumor process order #1964

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 6 additions & 0 deletions be2-scala/src/main/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<!--Configuration for ch.qos.logback-->
<!--Set debug to true to show debug logs on STDOUT-->
<configuration debug="false" scan="true" scanPeriod="15 seconds">
<akkaProperty name="AKKA_LOGLEVEL" path="akka.loglevel" />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} - %highlight(%-5level) : %logger{0} > %msg%n</pattern>
</encoder>
</appender>

<logger name="ch.epfl.pop" level="INFO" additivity="false">
<appender-ref ref="STDOUT" />
</logger>

<!--Set root(general) logs level to INFO/DEBUG on STDOUT-->
<root level="INFO">
<appender-ref ref="STDOUT"/>
</root>

</configuration>
Comment on lines 3 to 20
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these changes wanted ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Solved in DM: This is solving an issue where the "DEBUG" level would also apply to the dependencies as well making the logs quite cluttered.

Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,12 @@ object ProcessMessagesHandler extends AskPatternConstants {
case Some(rumorList) =>
val orderedRumors = rumorList.sortBy(_.timestamp)
var processedRumors: List[Rumor] = List.empty
var successful = true
for rumor <- orderedRumors if successful do {
successful = rumorHandler(messageRegistry, rumor) && writeRumorInDb(dbActorRef, rumor)
processedRumors = processedRumors.prepended(rumor)
for rumor <- orderedRumors do {
if writeRumorInDb(dbActorRef, rumor) && rumorHandler(messageRegistry, rumor) then
processedRumors = processedRumors.prepended(rumor)
}
if !successful then
system.log.info(s"Failed to process all rumors from rumorStateAnswer $jsonId. Processed rumors where ${processedRumors.map(rumor => (rumor.senderPk, rumor.rumorId)).tail}. Unprocessed rumors not written in memory.")
if processedRumors.size != orderedRumors.size then
system.log.info(s"Failed to process all rumors from rumorStateAnswer $jsonId. Processed rumors where ${if processedRumors.nonEmpty then processedRumors.map(rumor => (rumor.senderPk, rumor.rumorId)).tail else processedRumors}. Unprocessed rumors not written in memory.")
Left(PipelineError(
ErrorCodes.SERVER_ERROR.id,
s"Rumor state handler was not able to process all rumors from $msg",
Expand Down
Loading