Skip to content

Optimize ack messages for setups not collecting logs #4699

Merged
tysonnorris merged 5 commits intoapache:masterfrom
chetanmeh:optimize-logdriver-flow
Oct 30, 2019
Merged

Optimize ack messages for setups not collecting logs #4699
tysonnorris merged 5 commits intoapache:masterfrom
chetanmeh:optimize-logdriver-flow

Conversation

@chetanmeh
Copy link
Member

@chetanmeh chetanmeh commented Oct 23, 2019

Optimizes the ack message flow of setups which collect logs out of band i.e. where logs are not collected as part of activation message processing itself.

Fixes #4635

Description

Changes the ContainerProxy active ack flow when

  1. job.action.limits.logs.asMegaBytes == 0.MB
  2. OR LogDriverLogStore is being used

Now the behaviour is

  1. No log case
    1. Blocking action send CombinedCompletionAndResultMessage directly
    2. Non blocking action send CompletionMessage directly
  2. Logs case
    1. Blocking action
      1. Send ResultMessage
      2. Collect logs
      3. Send CompletionMessage
    2. Non blocking action
      1. Collect logs
      2. Send CompletionMessage

Related issue and scope

My changes affect the following components

  • API
  • Controller
  • Message Bus (e.g., Kafka)
  • Loadbalancer
  • Invoker
  • Intrinsic actions (e.g., sequences, conductors)
  • Data stores (e.g., CouchDB)
  • Tests
  • Deployment
  • CLI
  • General tooling
  • Documentation

Types of changes

  • Bug fix (generally a non-breaking change which closes an issue).
  • Enhancement or new feature (adds new functionality).
  • Breaking change (a bug fix or enhancement which changes existing behavior).

Checklist:

  • I signed an Apache CLA.
  • I reviewed the style guides and followed the recommendations (Travis CI will check :).
  • I added tests to cover my changes.
  • My changes require further changes to the documentation.
  • I updated the documentation where necessary.

@chetanmeh
Copy link
Member Author

Following test cases cover all the above 4 permutations

ContainerProxy should respond with CombinedCompletionAndResultMessage for blocking invocation with no logs
ContainerProxy should respond with ResultMessage and CompletionMessage for blocking invocation with logs
ContainerProxy should respond with only CompletionMessage for non blocking invocation with logs
ContainerProxy should respond with only CompletionMessage for non blocking invocation with no logs

@chetanmeh chetanmeh requested a review from rabbah October 23, 2019 10:38
@chetanmeh chetanmeh added the review Review for this PR has been requested and yet needs to be done. label Oct 23, 2019
Copy link
Member

@rabbah rabbah left a comment

Choose a reason for hiding this comment

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

LGTM.

}

val logsToBeCollected = collectLogs.logsToBeCollected(job.action)
val sendCompletionAfterLogsCollection = logsToBeCollected == true
Copy link
Member

Choose a reason for hiding this comment

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

instead of defining these two values which are essentially the same (value), how about just defining one value with this name and using it accordingly splitAckMessagesPendingLogCollection?

Copy link
Member Author

Choose a reason for hiding this comment

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

Naming is very hard so thanks for the suggestion :). Updated PR

@rabbah
Copy link
Member

rabbah commented Oct 28, 2019

Did this go out to the dev list - I haven't checked.

@chetanmeh
Copy link
Member Author

chetanmeh commented Oct 29, 2019

Initiated a mail thread today for this

@codecov-io
Copy link

codecov-io commented Oct 29, 2019

Codecov Report

Merging #4699 into master will decrease coverage by 6.44%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4699      +/-   ##
==========================================
- Coverage    84.8%   78.35%   -6.45%     
==========================================
  Files         196      198       +2     
  Lines        8803     8812       +9     
  Branches      603      598       -5     
==========================================
- Hits         7465     6905     -560     
- Misses       1338     1907     +569
Impacted Files Coverage Δ
...che/openwhisk/core/invoker/LogStoreCollector.scala 100% <100%> (ø)
.../openwhisk/core/containerpool/ContainerProxy.scala 92.96% <100%> (+0.07%) ⬆️
...penwhisk/core/containerpool/logging/LogStore.scala 100% <100%> (ø)
...core/containerpool/logging/LogDriverLogStore.scala 40% <100%> (+15%) ⬆️
...pache/openwhisk/core/invoker/InvokerReactive.scala 80.7% <100%> (+1.23%) ⬆️
...core/database/cosmosdb/RxObservableImplicits.scala 0% <0%> (-100%) ⬇️
...enwhisk/connector/kafka/KamonMetricsReporter.scala 0% <0%> (-100%) ⬇️
...e/database/cosmosdb/cache/ChangeFeedConsumer.scala 0% <0%> (-100%) ⬇️
...ore/database/cosmosdb/cache/CacheInvalidator.scala 0% <0%> (-100%) ⬇️
...core/database/cosmosdb/CosmosDBArtifactStore.scala 0% <0%> (-95.85%) ⬇️
... and 17 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f69ecb7...be1a5d8. Read the comment docs.

Copy link
Member

@style95 style95 left a comment

Choose a reason for hiding this comment

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

LGTM

@rabbah rabbah added the ready label Oct 30, 2019
@tysonnorris
Copy link
Contributor

Thanks @chetanmeh !

@tysonnorris tysonnorris merged commit 0b7bdb2 into apache:master Oct 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready review Review for this PR has been requested and yet needs to be done.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Combine active ack and slot release for setups not collecting logs directly

5 participants