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

Add Unique Queue infrastructure and move TestPullRequests to this #9856

Merged
merged 23 commits into from
Feb 2, 2020
Merged
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8eb4ce3
Upgrade levelqueue to version 0.2.0
zeripath Jan 26, 2020
ca14f21
Add UniqueQueue interface and functions to create them
zeripath Jan 26, 2020
22c4563
Add UniqueQueue implementations
zeripath Jan 26, 2020
92c2207
Move TestPullRequests over to use UniqueQueue
zeripath Jan 26, 2020
e6bd896
fix revive
zeripath Jan 29, 2020
7b967e0
Reduce code duplication
zeripath Jan 31, 2020
4b278ce
Merge remote-tracking branch 'origin/master' into unique-queues
zeripath Jan 31, 2020
486a8e0
Merge remote-tracking branch 'origin/master' into unique-queues
zeripath Jan 31, 2020
307f18a
Add bytefifos
zeripath Jan 31, 2020
028872e
fix locking in persistablechanneluniquequeue shutdown
zeripath Feb 1, 2020
8f6f779
rename queue pr_patch_checker
zeripath Feb 1, 2020
2d88ad7
Ensure invalid types are logged
zeripath Feb 1, 2020
23e7017
Move body of ByteFIFOQueue terminate out of select
zeripath Feb 1, 2020
a2fb188
Fix close race in PersistableChannelQueue Shutdown
zeripath Feb 1, 2020
f53c675
Fix double lock in unique wrapped
zeripath Feb 1, 2020
c54e2e4
Simplify PushFunc in Unique wrapped slightly
zeripath Feb 1, 2020
d82abd9
rename q fifo in queue_disk and handle not found err in unique_queue_…
zeripath Feb 1, 2020
47d94a1
Lock for Empty and readToChan
zeripath Feb 1, 2020
343cded
Merge branch 'master' into unique-queues
zeripath Feb 1, 2020
5ab601b
Merge branch 'master' into unique-queues
zeripath Feb 1, 2020
25c1427
Add some more comments
zeripath Feb 2, 2020
111a87e
Merge branch 'master' into unique-queues
zeripath Feb 2, 2020
6b368d6
Merge branch 'master' into unique-queues
zeripath Feb 2, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Simplify PushFunc in Unique wrapped slightly
  • Loading branch information
zeripath committed Feb 1, 2020
commit c54e2e4770be96b35eb0c9ef094dc5b34760d6d1
9 changes: 2 additions & 7 deletions modules/queue/unique_queue_wrapped.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,21 +91,16 @@ func (q *WrappedUniqueQueue) Push(data Data) error {

// PushFunc will push the data to the internal channel checking it against the exemplar
func (q *WrappedUniqueQueue) PushFunc(data Data, fn func() error) error {
q.tlock.Lock()
if q.ready {
q.tlock.Unlock()
return q.internal.(UniqueQueue).PushFunc(data, fn)
}
q.tlock.Unlock()

if !assignableTo(data, q.exemplar) {
zeripath marked this conversation as resolved.
Show resolved Hide resolved
return fmt.Errorf("Unable to assign data: %v to same type as exemplar: %v in %s", data, q.exemplar, q.name)
}

q.tlock.Lock()
if q.ready {
q.tlock.Unlock()
return q.internal.(UniqueQueue).PushFunc(data, fn)
}

locked := true
defer func() {
if locked {
Expand Down