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

Issues: 455, 456, 458 - Timeouts and msgs #461

Merged
merged 3 commits into from
Feb 4, 2021

Conversation

bmpotter
Copy link
Member

@bmpotter bmpotter commented Feb 4, 2021

  • Issue 456: Change config value akka.http.server.request-timeout to 45s
  • Issue 455: Avoid DB reads if maxMessagesInMailbox and maxAgreements are 0 which is default and means unlimited
  • Issue 458: Lower default values of resourceChanges ttl and cleanupInterval

Bruce Potter added 2 commits February 4, 2021 00:47
Signed-off-by: Bruce Potter <bp@us.ibm.com>
…re 0. Issue 458: Lower default values of resourceChanges ttl and cleanupInterval

Signed-off-by: Bruce Potter <bp@us.ibm.com>
db.run(AgbotAgreementsTQ.getNumOwned(compositeId).result.flatMap({ xs =>
val maxAgreements = ExchConfig.getInt("api.limits.maxAgreements")
val getNumOwnedDbio = if (maxAgreements == 0) DBIO.successful(0) else AgbotAgreementsTQ.getNumOwned(compositeId).result // avoid DB read for this if there is no max
db.run(getNumOwnedDbio.flatMap({ xs =>
logger.debug("PUT /orgs/"+orgid+"/agbots/"+id+"/agreements/"+agrId+" num owned: "+xs)

Choose a reason for hiding this comment

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

Wondering if this debug message will be confusing to someone looking at logs for the case where maxAgreements and maxMessages will be 0. The log message will indicate that "num owned" will be 0 when in fact the code didn't check the value. Same comment for the places in NodeRoutes

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, good catch, i missed that one. I'll fix...

// Remove msgs whose TTL is past, then check the mailbox is not full, then get the node publicKey, then write the agbotmsgs row, all in the same db.run thread
db.run(AgbotMsgsTQ.getNumOwned(compositeId).result.flatMap({ xs =>
db.run(getNumOwnedDbio.flatMap({ xs =>
logger.debug("POST /orgs/"+orgid+"/agbots/"+id+"/msgs mailbox size: "+xs)

Choose a reason for hiding this comment

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

same comment for the debug message for mailbox size

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll fix this too...

Signed-off-by: Bruce Potter <bp@us.ibm.com>
@bmpotter bmpotter merged commit 015796d into open-horizon:master Feb 4, 2021
@bmpotter bmpotter deleted the timeouts-and-msgs branch February 4, 2021 15:44
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.

2 participants