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

Queue up observe messages #48

Merged
merged 1 commit into from
Aug 15, 2024
Merged

Queue up observe messages #48

merged 1 commit into from
Aug 15, 2024

Conversation

reynir
Copy link
Contributor

@reynir reynir commented Aug 15, 2024

Regular data messages are queued when there are less than 100 messages for that client. Build finish messages are always enqueued. This ensures end messages are never lost, and enhances the user experience for the client as a busy build will drop less messages.

The more function depends on Lwt_condition.signal does not yield so the function doesn't yield before the next Lwt_condition.wait thus more never misses a message.

The number 100 is arbitrary chosen.

I tested on my builder setup, but I don't know how to reproduce missed messages.

Regular data messages are queued when there are less than 100 messages
for that client. Build finish messages are always enqueued. This ensures
end messages are never lost, and enhances the user experience for the
client as a busy build will drop less messages.
@hannesm
Copy link
Contributor

hannesm commented Aug 15, 2024

To me this looks fine. I was worried that there may be memory leaked, but the queue is very locally allocated in the client-loop, and thus this should be safe.

I'll merge. We can reconsider if we encounter any issues. Thanks a lot! :)

@hannesm hannesm merged commit edd6032 into main Aug 15, 2024
1 check passed
@hannesm hannesm deleted the queue-observe-messages branch August 15, 2024 20:44
hannesm added a commit to hannesm/opam-repository that referenced this pull request Sep 4, 2024
CHANGES:

* improve documentation (robur-coop/builder#37 et al, fixes robur-coop/builder#27)
* adapt to asn1-combinators 0.3.0 API: remove cstruct (robur-coop/builder#49 @hannesm)
* queue up observe messages (robur-coop/builder#48 @reynir)
* use "/job/_/build/_/main-binary" alias - eases bootstrapping (robur-coop/builder#42 @reynir)
* drop platform: advice to shutdown workers (robur-coop/builder#39 @reynir)
* FreeBSD: add builder_worker service script (robur-coop/builder#37 @hannesm)
* client: enumerate valid periods in `--help` (robur-coop/builder#36 @reynir)
* add an interval of "never" to never schedule a job (robur-coop/builder#34 @hannesm, fixes robur-coop/builder#32)
* client: observe omit the UUID (robur-coop/builder#33 @hannesm)
avsm pushed a commit to avsm/opam-repository that referenced this pull request Sep 5, 2024
CHANGES:

* improve documentation (robur-coop/builder#37 et al, fixes robur-coop/builder#27)
* adapt to asn1-combinators 0.3.0 API: remove cstruct (robur-coop/builder#49 @hannesm)
* queue up observe messages (robur-coop/builder#48 @reynir)
* use "/job/_/build/_/main-binary" alias - eases bootstrapping (robur-coop/builder#42 @reynir)
* drop platform: advice to shutdown workers (robur-coop/builder#39 @reynir)
* FreeBSD: add builder_worker service script (robur-coop/builder#37 @hannesm)
* client: enumerate valid periods in `--help` (robur-coop/builder#36 @reynir)
* add an interval of "never" to never schedule a job (robur-coop/builder#34 @hannesm, fixes robur-coop/builder#32)
* client: observe omit the UUID (robur-coop/builder#33 @hannesm)
avsm pushed a commit to avsm/opam-repository that referenced this pull request Sep 5, 2024
CHANGES:

* improve documentation (robur-coop/builder#37 et al, fixes robur-coop/builder#27)
* adapt to asn1-combinators 0.3.0 API: remove cstruct (robur-coop/builder#49 @hannesm)
* queue up observe messages (robur-coop/builder#48 @reynir)
* use "/job/_/build/_/main-binary" alias - eases bootstrapping (robur-coop/builder#42 @reynir)
* drop platform: advice to shutdown workers (robur-coop/builder#39 @reynir)
* FreeBSD: add builder_worker service script (robur-coop/builder#37 @hannesm)
* client: enumerate valid periods in `--help` (robur-coop/builder#36 @reynir)
* add an interval of "never" to never schedule a job (robur-coop/builder#34 @hannesm, fixes robur-coop/builder#32)
* client: observe omit the UUID (robur-coop/builder#33 @hannesm)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants