Skip to content
This repository has been archived by the owner on Oct 31, 2023. It is now read-only.

Add deadlines to message queue entries #5106

Merged
merged 5 commits into from
Feb 27, 2020
Merged

Add deadlines to message queue entries #5106

merged 5 commits into from
Feb 27, 2020

Conversation

kmazurek
Copy link
Contributor

@kmazurek kmazurek commented Feb 26, 2020

Adds a deadline field to the the database model QueuedMessage. Extends
message queue logic to discard messages which are past their deadline.
When putting new messages to the queue an optional timeout parameter
can be specified. A message's deadline is derived from this timeout.

This change also adds a timeout for ResourceHandshakeStart and
WantToComputeTask messages.

fixes: #5105

Adds a deadline field to the the database model QueuedMessage. Extends
message queue logic to discard messages which are past their deadline.
When putting new messages to the queue an optional timeout parameter
can be specified. A message's deadline is derived from this timeout.

This change also adds a timeout for ResourceHandshakeStart and
WantToComputeTask messages.
@kmazurek kmazurek self-assigned this Feb 26, 2020
golem/model.py Outdated Show resolved Hide resolved
golem/model.py Show resolved Hide resolved
Copy link
Contributor

@etam etam left a comment

Choose a reason for hiding this comment

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

ok

@etam
Copy link
Contributor

etam commented Feb 27, 2020

BTW, why is this needed?

@codecov
Copy link

codecov bot commented Feb 27, 2020

Codecov Report

Merging #5106 into develop will increase coverage by <.01%.
The diff coverage is 100%.

@@             Coverage Diff             @@
##           develop    #5106      +/-   ##
===========================================
+ Coverage    90.01%   90.02%   +<.01%     
===========================================
  Files          234      234              
  Lines        22082    22091       +9     
===========================================
+ Hits         19877    19887      +10     
+ Misses        2205     2204       -1

- variables.MESSAGE_QUEUE_MAX_AGE
count = model.QueuedMessage.delete().where(
count += model.QueuedMessage.delete().where(
Copy link
Contributor

Choose a reason for hiding this comment

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

Please use only deadline here

@kmazurek
Copy link
Contributor Author

@etam Together with setting the timeout for ResourceHandshakeStart it resolves https://github.com/golemfactory/golem/issues/5105. Apart from that it can be used for other messages which have a clearly defined lifetime (e.g. WantToComputeTask, I set it to use the deadline from its task header).

@kmazurek kmazurek merged commit 6f4df24 into develop Feb 27, 2020
@kmazurek kmazurek deleted the msg-queue-deadline branch February 27, 2020 14:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Resource Handshake Error due to outdated Message Queue messages
3 participants