question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ScopeManager can get confused when dealing with a heavy thread load.

See original GitHub issue

Environment

Liquibase Version: 4.5

Liquibase Integration & Version: gradle

Liquibase Extension(s) & Version:

Database Vendor & Version: Sql Server 2018 at least

Operating System Type & Version: Linux inside Kubernetes pods

Description

We use Liquibase to perform migrations in a service hosted in a Kubernetes cluster, our service is multithreaded and we can updated several thousand databases at a time. We were on Liquibase 3.10 but were getting the occasional concurrentModification exception. I updated our service to utilize version 4.5 because it looked like the newer version handled that exception. I deployed the changes yesterday and saw 3557 migration failures when the processing window opened. This was the error (the scope names were all different)

liquibase.exception.LiquibaseException: java.lang.RuntimeException: Cannot end scope ehscwwaeie when currently at scope otgxsyxdtb at liquibase.Liquibase.runInScope(Liquibase.java:2409) at liquibase.Liquibase.update(Liquibase.java:211) at liquibase.Liquibase.update(Liquibase.java:197) at liquibase.Liquibase.update(Liquibase.java:193) at liquibase.Liquibase.update(Liquibase.java:185) at com.concur.reportdbservice.manager.ReportingSchemaMgr.update(ReportingSchemaMgr.java:66) at com.concur.reportdbservice.service.ReportingSchemaService.updateDatabase(ReportingSchemaService.java:46) at com.concur.reportdbservice.service.MigTaskService.entityMigrate(MigTaskService.java:48) at com.concur.reportdbservice.thread.MigMigrateJob.executeJob(MigMigrateJob.java:27) at com.concur.reportdbservice.thread.Job.run(Job.java:46) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.base/java.util.concurrent.FutureTask.run(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.base/java.lang.Thread.run(Unknown Source) Caused by: java.lang.RuntimeException: Cannot end scope ehscwwaeie when currently at scope otgxsyxdtb at liquibase.Scope.exit(Scope.java:226) at liquibase.Scope.child(Scope.java:188) at liquibase.Scope.child(Scope.java:176) at liquibase.Scope.child(Scope.java:155) at liquibase.Liquibase.runInScope(Liquibase.java:2404)

Steps To Reproduce

We have 8 processing pods that send a request to 3 pods which use liquibase to perform the schema updates. Each of the liquibase service pods runs a service that creates a new thread for each request coming in.

Actual Behavior

The error message was recorded above

Expected/Desired Behavior

We can run a heavy load of schema migrations successfully like was the case in version 3.10

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:19 (9 by maintainers)

github_iconTop GitHub Comments

7reactions
adamjones0101commented, Jan 18, 2022

We are also experiencing this issue. We use Liquibase to perform upgrades in a Kubernetes environment on Linux. Our service is multithreaded and we usually upgrade only 10 to 50 databases in parallel yet this error is pervasive. We have used Liquibase version 3.8.5 for years without any issues but all of our attempts to upgrade to various levels of Version 4 have failed with this error. We use liquibase jar files, create a new Liquibase object and call the update method. PLEASE FIX THIS!!! This is a major regression for us. I am representing a fortune 500 company that depends on liquibase to maintain database integrity for our customers.

2reactions
chaitanyawhocommented, Aug 26, 2022

I’m facing this issue as well, is there a fix planned for this anytime soon?

Read more comments on GitHub >

github_iconTop Results From Across the Web

opentracing/public - Gitter
I am trying to do some simple demo with OpenTracing and Jaeger. I have a set of finite state machines that communicate over...
Read more >
Using a dispatch_once singleton model in Swift - Stack Overflow
So far, I've been able to get a non-thread safe model working as: class var sharedInstance: TPScopeManager { get { struct Static {...
Read more >
Opentracing Python: OpenTracing API For Python - Morioh
In order to understand the Python platform API, one must first be familiar with ... instrumentation libraries it is using, exposed as a...
Read more >
Citrix Profile Management 2209 – Carl Stalhood
There are four methods of delivering configuration settings to the Citrix ... Hard Code Store Path – Instead of using variables, you can...
Read more >
Search field in Settings no longer works (Windows 11 22H2)
I also have a recent thread on this same indexing thing, all these index comments here really should have been over at that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found