-
Notifications
You must be signed in to change notification settings - Fork 321
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
Conversation
if (!wasActivated.get()) { | ||
if (!wasActivated.getAndSet(true)) { | ||
onFirstActivation(); | ||
} | ||
} |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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"); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly.
public void setPartialTransactionHandler(Consumer<Transaction> transactionHandler) { | ||
this.partialTransactionHandler = transactionHandler; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[minor] seems unused.
There was a problem hiding this comment.
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
.
# Conflicts: # CHANGELOG.asciidoc
What does this PR do?
Closes #2999 .
Checklist
Added an API method or config option? Document in which version this will be introducedI have made corresponding changes to the documentation