Skip to content

table lock - concurrency problem #120

@volker-raschek

Description

@volker-raschek

Hello folks,
I have written an oracle driver for https://github.com/golang-migrate/migrate using godror as the driver. To prevent multiple instances from migrating an oracle database the schema_lock table is locked and a row is inserted. Other instances should then not start the migration.

Locally on my system and inside a container, the tests run successfully. In our internal CI the test fails with the same container image.

Information:

  • godror v0.22.2
  • go version 1.15.6
  • oracle client: 19.8.0.0.0
  • oracle db version: 12c

Under the project https://github.com/volker-raschek/locker I have implemented everything to reproduce the error. Again, local on my system the test is successfully, but in our internal CI the test fails.

Unfortunately I can't catch the error with an ORA error code, because it doesn't contain one. Sometimes I get an error message like this one dpiStmt_execute(mode=0 arrLen=-1): or nothing. I am not sure if there is something wrong with my source code or the SQL statements or godror has a bug.

Please have a look at my sample code and the logs and reproduce the error if necessary.

Volker

To Reproduce

git clone https://github.com/volker-raschek/locker
make start-oracle-xe
sleep 300 # wait until db is ready
make container-run/test/unit # maybe you must adapt DB_URL in Makefile

Expected behavior

The intergration tests are successfully on both systems (local and ci)

logs are attached as seperate files

ci.log
local-system.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions