Closed tasso94 closed 2 weeks ago
bytearray
will not be nullIf the conditions are not identified, it doesn't give a lot of value to add a Unit Test that reproduces the example with arbitrary steps or private calls.
Next steps:
postgres15
and audit
history level did not reproduce the issueThe inability to reproduce the problem with a unit test it accepted. Moving on with backporting of the fix.
Context: Not Delete the ByteArray upon Update
Introduction: The VariableInstanceEntity
can store the variable values either:
long
, double
, text
values) orobject
typesObservation: In the scenario where the type changes, e.g from long
to object
:
master
, the byte-array is deleted and no reference can be found on the variable db entry.SUPPORT-21712
, there is a reference of the bytearray
and its not deleted from the variable db entryNote: The public API correctly returns the correct type and value.
Potential Problem: The above raises concerns of potential side-effects introduced.
Solution Ideas: A mechanism to delete the byte-array on type change is needed
Kudos to @yanavasileva for coming up with this scenario.
Hey @tasso94,
After the latest update, i went ahead and added unit-tests for ensuring the right state population of the variable on type change (see the PR notes for the reviewer).
After the PR is finalised and approved, i'll proceed with back-porting.
Will assign the issue to you once the CI passes against theci:all-db
profile.
All pipelines passed against the ci:all-db
profile.
Assigning to @tasso94 for Review.
Hi @psavidis, can you please assign this review to somebody else on the team? Let's try to spread the knowledge among engineers.
Assigning to @yanavasileva for the Review
Assigning for a final review round of the backports
❗ backport PRs don't have the latest commits from master.
❗ backport PRs don't have the latest commits from master.
They were outdated after the last changes to avoid deserialising the variables during type checks. The backports now are force-pushed with the new commit
Merged the main fix and backports. Closing the issue.
Potential labels were not replaced by version labels which broke the process of informing the customer.
Environment (Required on creation)
Most likely, all Camunda versions are affected.
Description (Required on creation; please attach any relevant screenshots, stacktraces, log files, etc. to the ticket)
Process variables turn unexpectedly null when jobs are executed in parallel.
Steps to reproduce (Required on creation)
asyncBefore
, which first reads process variable A and second updates process variable A.Object
.Observed Behavior (Required on creation)
Process variables turn null.
Expected behavior (Required on creation)
Process variables don't turn null.
Root Cause (Required on prioritization)
Object
, the value is stored in the byte array table, and the row in the runtime variable table references the row in the byte array table.SetVariable
.Solution Ideas
Reuse the byte array row by updating it. Like this, the variable value cannot turn
null
.Hints
See the prototypical implementation that was validated with the customer: https://github.com/camunda/camunda-bpm-platform/pull/4313
Links
Breakdown
Dev2QA handover