-
Notifications
You must be signed in to change notification settings - Fork 70
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 save inventory thread for streaming refresh #233
Conversation
fe4cb19
to
61c3536
Compare
61c3536
to
17419e8
Compare
@agrare dep merged, please rebase we can talk later about the IC concat. To isolate the functionality, I would probably lean to Concatenate class, that would work with serialized ICs (Hash, parsed out of json). At this point it would be just merging of the hashes. What do you think? |
17419e8
to
3ee682f
Compare
@Ladas okay rebased |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extracting the saver is nice. adds some complexity, but it gives us a long desired need of merging duplicate refresh requests.
The saver is good as long as it is intended to be single threaded. And adding a mutex around ensure_saver_thread
would make it thread safe. (overkill for now - and would just slow us down in the single threaded case)
3ee682f
to
30e835f
Compare
30e835f
to
808284b
Compare
Checked commit agrare@808284b with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 app/models/manageiq/providers/vmware/infra_manager/inventory/saver.rb
|
|
||
def dequeue | ||
queue.deq(:non_block => true) | ||
rescue ThreadError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably some log here would be nice? we can do it in next PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great
…lure Refresh template if sealing failed
This change adds a save inventory thread to help mitigate issues with lots of small updates overwhelm saving.
TODO: I'd like to concatenate the inventory collections which were queued so that e.g. hundreds of single changes are handled by a single refresh.
Depends: