nisiyong opened a new pull request #6009: URL: https://github.com/apache/skywalking/pull/6009
### Fix Non-atomic operation on volatile field - [x] Add a unit test to verify that the fix works. - [x] Explain briefly why the bug exists and how to fix it. - [x] Fix #5606, this PR didn't fix the bug. - [x] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/CHANGES.md). Recently I dive into SkyWalking sources code, and I find some bugs in the `DataCarrier` module. It runs with something wrong although they won't affect the main feature. IntelliJ IDEA shows the warning as follow: > Inspection info: Reports any non-atomic operations on volatile fields. Non-atomic operations on volatile fields are operations where the field is read and the value is used to update the field. It is possible for the value of the field to change between the read and the write, possibly invalidating the operation. The non-atomic operation can be avoided by surrounding it with a synchronized block or by making use of one of the classes from the java.util.concurrent.atomic package. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected]
