-
Notifications
You must be signed in to change notification settings - Fork 329
Polling Support #1109
Polling Support #1109
Conversation
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 good, mostly questions around some comment clarity.
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.
Exciting to see this come together! I haven't stepped through everything, but I left a couple of change requests and questions for now 😄
} | ||
|
||
// wait for deletion to complete | ||
err = wait.PollImmediate(2*time.Second, 10*time.Minute, func() (bool, error) { |
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.
I've noticed we end up waiting 10 minutes for a lot of things in the k8s platform. Is this a reasonable amount of time? Is 5 minutes not enough?
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.
On Azure stuff like PVCs sometimes take that long. :|
internal/server: proto internal/server: proto changes to list by workspace internal/server: proto changes internal/server: proto changes
This stops the poll queuer.
Co-authored-by: Brian Cain <bcain@hashicorp.com>
This introduces support for polling and triggering an
up
on any changes in Git.The primary architecture of this is as follows: the
Project
structure maintains the polling settings. New APIs were added to thestate
package to grab the next project to poll that returns a deadline (when to poll). A new single goroutine poller is now started by the server which grabs that next project to poll, waits until the deadline, then queues a poll job. There is some watchset handling in there to detect the case that the project settings changes or projects were added/removed.Note, especially for @evanphx: I'm still unhappy with the datasource interface in general and still want to take a broad pass at that. For this PR, I just kind of forced in the interface functions required to make this work. This is all internal logic though and we only have one real implementation (Git) so I think we can fix this up later without affecting any users.
I expect this to have bugs and imperfections! I did my best to test various cases. This PR is primarily about laying the major minimum implementation for this feature.