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

Implement partial transactions for AWS Lambda #3134

Merged
merged 5 commits into from
May 5, 2023

Conversation

JonasKunz
Copy link
Contributor

@JonasKunz JonasKunz commented May 4, 2023

What does this PR do?

Closes #2999 .

Checklist

  • This is an enhancement of existing features, or a new feature in existing plugins
    • I have updated CHANGELOG.asciidoc
    • I have added tests that prove my fix is effective or that my feature works
    • Added an API method or config option? Document in which version this will be introduced
    • I have made corresponding changes to the documentation

@apmmachine
Copy link
Contributor

apmmachine commented May 4, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview previewSnapshots

Expand to view the summary

Build stats

  • Start Time: 2023-05-05T15:11:14.508+0000

  • Duration: 13 min 28 sec

❕ Flaky test report

No test was executed to be analysed.

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark tests.

  • run jdk compatibility tests : Run the JDK Compatibility tests.

  • run integration tests : Run the Agent Integration tests.

  • run end-to-end tests : Run the APM-ITs.

  • run windows tests : Build & tests on windows.

  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@JonasKunz JonasKunz requested a review from a team May 5, 2023 11:30
Comment on lines +187 to +191
if (!wasActivated.get()) {
if (!wasActivated.getAndSet(true)) {
onFirstActivation();
}
}
Copy link
Member

Choose a reason for hiding this comment

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

[minor] the outer if seems redundant here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a small performance optimization: get() on an atomic is a volatile read, which costs the same as a normal read. getAndSet() is an atomic operation (similar to CAS) and therefore comes with the memory-barrier penalty like other atomic operations. I'll add a comment to clarify

Transaction tx1 = tracer
.startRootTransaction(null)
.withName("faas-transaction");
tx1.getFaas().withExecution("foo-bar-id");
Copy link
Member

Choose a reason for hiding this comment

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

[question] if I understand correctly the withExecution call makes the transaction as a FAAS transaction, in opposition to a "regular" transaction where this is not called.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exactly.

Comment on lines +211 to +213
public void setPartialTransactionHandler(Consumer<Transaction> transactionHandler) {
this.partialTransactionHandler = transactionHandler;
}
Copy link
Member

Choose a reason for hiding this comment

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

[minor] seems unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is actually used by the PartialTransactionTest to plugin a real PartialTransactionReporter into the MockReporter.

@JonasKunz JonasKunz merged commit 3e4005d into elastic:main May 5, 2023
@JonasKunz JonasKunz deleted the partial-transactions branch May 5, 2023 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[META 753] Support Partial Transaction for AWS Lambda
3 participants