Skip to content

Move worker queues in it's own library#6874

Open
GabrielBuica wants to merge 9 commits intoxapi-project:masterfrom
GabrielBuica:private/dbuica/CP-28067
Open

Move worker queues in it's own library#6874
GabrielBuica wants to merge 9 commits intoxapi-project:masterfrom
GabrielBuica:private/dbuica/CP-28067

Conversation

@GabrielBuica
Copy link
Contributor

This is part 1 of the revival of xapi-project/xenopsd#337.

I am trying to split it over multiple PRs and commits that can be reviewed on by one, instead of having one huge PR.

It passes, BVT+BST.

Gabriel Buica added 8 commits January 29, 2026 10:53
…the workerpool

Confusingly, `item` was used to describe both the (operation * handle) pair,
and the 'handle' itself.
Keep calling the elements of the queue 'item', and use 'handle' for the other.

Introduce describe_item to access the short description/operation for debug
purposes.

No functionality change.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Gabriel Buica <danutgabriel.buica@citrix.com>
…of worker pools

Needed to functorize the worker pools.
No functionality change.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Gabriel Buica <danutgabriel.buica@citrix.com>
from worker pools

Signed-off-by: Edwin Török <edvin.torok@citrix.com>

Signed-off-by: Gabriel Buica <danutgabriel.buica@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Gabriel Buica <danutgabriel.buica@citrix.com>
No functionality change.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Gabriel Buica <danutgabriel.buica@citrix.com>
Signed-off-by: Gabriel Buica <danutgabriel.buica@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Gabriel Buica <danutgabriel.buica@citrix.com>
Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Gabriel Buica <danutgabriel.buica@citrix.com>
TODO: these will need a bit of clean up.
Right now, these will just make the CI ignore these.

Signed-off-by: Gabriel Buica <danutgabriel.buica@citrix.com>
module TaskDump = struct
type t = {
id: string
; ctime: string
Copy link
Member

Choose a reason for hiding this comment

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

This should be amde an Mtime.span, but that will need non-trivial changes.
Because it's converted from a float, it should currently be an int64, or Date.t (they are equivalent)

@@ -0,0 +1,27 @@
# This file is generated by dune, edit dune-project instead
Copy link
Member

Choose a reason for hiding this comment

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

Could you open a PR in xs-opam adding this package? Add it as well to to https://github.com/xapi-project/xs-opam/blob/master/tools/sync-xapi-metadata.sh

open D

let rpc_of ty x = Rpcmarshal.marshal ty.Rpc.Types.ty x
let _rpc_of ty x = Rpcmarshal.marshal ty.Rpc.Types.ty x
Copy link
Member

Choose a reason for hiding this comment

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

Is the commit with a TODO really needed? I would prefer a commit that removes it, then a revert that reintroduces the bindings when they are needed

@psafont
Copy link
Member

psafont commented Jan 29, 2026

I guess the intention is to reuse these, seem like a good cleanup. The only objectionable thing I find here is the commit with the TODO

Note that calls to [finally] are not serialised!
*)

val should_keep : t -> t list -> bool
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used to check redundancy of an item based on other items (operations) in the queue? The name is not capturing this well and the description is not using a term like equivalence or redundancy which could convey the concept.


module type S = sig
(** work item *)
type item
Copy link
Contributor

Choose a reason for hiding this comment

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

job or work would have been a better name

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