Skip to content

FileLockBasedLockChecker error attempting to release locks held by other processes #63

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
marksantos opened this issue Jul 18, 2020 · 2 comments

Comments

@marksantos
Copy link

marksantos commented Jul 18, 2020

To control which CPUs a specific-process can be pinned to in a multi-process affinity-enabled environment, the setting affinity.reserved can be specified to reserve specific CPUs per application.

When running multiple-applications with different reserved CPUs - the following error message can occur

ERROR FileLockBasedLockChecker - Cannot release lock for id XX as don't have it!

This seems to be due to ThreadAffinity checking the state of ALL lockfiles before checking which lockfiles are actually associated with the application's reserved CPUs:

final boolean canReserve(boolean specified) {

        // (1) Processes lockfiles...
        if (!LockCheck.isCpuFree(cpuId))
            return false;

        // (2) ....only checks reserved status here
        if (!specified && !reservable) return false;

        ...

As lock files for ALL processes using the library are stored in java.io.tmpdir by default - applications incorrectly process lockfiles reserved for other applications during step (1) and the error message results.

Minor issue with high loglevel (ERROR)

Version: affinity-3.2.1

@RobAustin
Copy link
Contributor

RobAustin commented Jul 18, 2020 via email

@JerryShea
Copy link
Contributor

JerryShea commented May 18, 2021

@marksantos that was a somewhat delayed close ;)

m-anthony pushed a commit to m-anthony/Java-Thread-Affinity that referenced this issue Nov 24, 2021
m-anthony pushed a commit to m-anthony/Java-Thread-Affinity that referenced this issue Nov 24, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants