influxdb/cmd/influxd
Johnny Steenbergen 596d8fde45 feat(pkger): add stateful management for tasks
notes on this commit. This commit was grueling ;-(. The task API is not a friendly
API to consume. There are a lot of non obvious things going on and almost every
one of them tripped me up. Things of note:

* the http.TaskService does not satisfy the influxdb.TaskService,
  making it impossible to use as a dependency if tasks service gets
  split out
* the APIs for create and update do not share common types. For example:
  creating a task takes every field as a string, but in the update it is
  taken as a options.Duration type. A step further and you'll notice that
  create does not need an option to be provided, but the update does. Its
  jarring trying to understand the indirection here. I struggled mightily
  trying to make sense of it all with the indirection and differing types.
  Made for a very difficult task (no pun intended) when it should have been
  trivial. Opportunity here to fix these up and make this API more uniform
  and remove unneccesary complexity like the options type.
* Nested IDs that get marshaled, are no bueno when you want to marshal a task
  that does not have an ID in it, for either user/org/or self IDs. Its a challenge
  just to do that.
* Lots of logs in the kv.Task portion where we hit errors and log and others where
  we return. It isn't clear what is happening. The kv implementation is also very
  procedural, and I found myself bouncing around like a ping pong ball trying to
  make heads or tails of it.
* There is auth buried deep inside the kv.Task implementation that kept throwing me
  off b/c it kept throwing errors, instead of warns. I assume, not sure if I'm
  correct on this, but that the stuff being logged is determined inconsequential
  to the task working. I had lots of errors from the auth buried in there, and hadn't
  a clue what to make of it....

leaving these notes here as a look back at why working with tasks is so
difficult. This API can improve dramatically. I spent 5x the time trying
to figure out how to use the task API, in procedural calls, than I did
writing the business logic to consume it.... that's a scary realization ;-(

references: #17434
2020-04-21 09:14:20 -07:00
..
generate refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
inspect refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
internal/profile refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
launcher feat(pkger): add stateful management for tasks 2020-04-21 09:14:20 -07:00
migrate refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
restore refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00
main.go refactor: rewrite imports to include the /v2 suffix for version 2 2020-04-03 12:39:20 -05:00