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

make BufferedLogService thread safe #3470

Merged
merged 1 commit into from
Nov 16, 2022
Merged

Conversation

StevenMassaro
Copy link
Contributor

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Makes the underlying log store for the BufferedLogService thread safe.

Things to be aware of

We occasionally get errors like:

java.util.ConcurrentModificationException
	at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1043)
	at java.base/java.util.ArrayList$Itr.next(ArrayList.java:997)
	at liquibase.logging.core.BufferedLogService.getLogAsString(BufferedLogService.java:39)
	at ...

in the pro integration tests, this should resolve them.

Things to worry about

Performance impacts from the synchronized list? This is unlikely because Liquibase is not a terribly thread-heavy application.

Additional Context

@github-actions
Copy link

github-actions bot commented Nov 15, 2022

Unit Test Results

  4 740 files  ±0    4 740 suites  ±0   35m 25s ⏱️ -44s
  4 693 tests ±0    4 457 ✔️ ±0     236 💤 ±0  0 ±0 
55 536 runs  ±0  50 228 ✔️ ±0  5 308 💤 ±0  0 ±0 

Results for commit 5a91345. ± Comparison against base commit 0aa4be9.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@filipelautert filipelautert left a comment

Choose a reason for hiding this comment

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

JVM must be smart enough that performance impact in single thread environments may be 0.

@StevenMassaro StevenMassaro merged commit 665a311 into master Nov 16, 2022
@StevenMassaro StevenMassaro deleted the threadsafe-log-buffer branch November 16, 2022 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants