Skip to content

Conversation

cstamas
Copy link
Member

@cstamas cstamas commented Apr 27, 2021

Now that TrackingFileManager is shared singleton, let's make it use NamedLockFactory.

Commits:
Step1: drop all SyncContextFactory implementations and indirections, redo the same functionality using NamedLocks.
Step2: Pull out NamedLockFactory selection and expose selected one.
Step3: Tie up selected NamedLockFactory to TrackingFileManager.
Step4: use locking
Step5 keying for files., prefix + sha1(path)

cstamas added 3 commits April 27, 2021 14:38
Step1: drop all SyncContextFactory implementations and indirections, redo the same
functionality using NamedLocks.
@cstamas cstamas requested a review from michael-o April 27, 2021 13:00
@cstamas cstamas self-assigned this Apr 27, 2021
cstamas added 5 commits April 27, 2021 15:18
It was in SISU (due SISU index) and in ServiceLocator (kinda),
but was not in Guice, but it worked, as it has default ctor.

Once default ctor (along with ServiceLocator) is gone, these errors
will be easier to spot.

RandomAccessFile raf = null;
try
try ( NamedLock lock = namedLockFactory.getLock( getFileKey( file ) ) )
Copy link
Member

Choose a reason for hiding this comment

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

This suffers now from one problem. Since we don't use name mappers you will have the SAME lock name on two different CI nodes with Redisson using the same directory structure. They will block each other for no reason. Makes sense?

Copy link
Member

Choose a reason for hiding this comment

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

Use selector here?

Copy link
Member Author

Choose a reason for hiding this comment

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

on two different nodes using two different storage mounts (disks), why'd you use redisson to sync those two (unrelated) nodes at all?

Copy link
Member

Choose a reason for hiding this comment

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

My point is that I expect consistent approach to name mapping wherever the lock factory is used. I need to think about this more tomorrow.

Copy link
Member

@michael-o michael-o left a comment

Choose a reason for hiding this comment

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

.

@cstamas
Copy link
Member Author

cstamas commented Apr 29, 2021

@cstamas note to myself: split this in two: drop SyncContextFactory imples (other than named), and implement locking in TFM

@cstamas
Copy link
Member Author

cstamas commented Apr 30, 2021

Superseded by these two (sorry, as one depends on another, I could put it into my fork only, as I started all this work on a fork):
1st: #102
2nd: cstamas#3

@cstamas cstamas closed this Apr 30, 2021
@jira-importer
Copy link

Resolve #925

1 similar comment
@jira-importer
Copy link

Resolve #925

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.

3 participants