Closed cygnusv closed 11 months ago
I may have confused you with my responses previously.
This _SHORT_LEARNING_DELAY
delay is the staggering of the learning task when rotating to a new teacher to ask about its nodes. It's the time between learning from one teacher, and starting to learn from another teacher. See https://github.com/nucypher/nucypher/blob/v7.0.0/nucypher/network/nodes.py#L508. It's a class variable for Learner
which Porter modifies for itself
I suspect the timeout in the exception you observed above is from nucypher
's RestMiddleware
object used by Learner
when attempting to get information about a node which is done here - https://github.com/nucypher/nucypher/blob/v7.0.0/nucypher/network/middleware.py#L118.
That has a constant timeout of 2s. Porter is a subclass of Learner
and is therefore subjected to the same timeout. So really this is a Middleware/Learner
object issue in nucypher
.
More generally, questions have been raised in nucypher
about the hardcoding of timeouts as opposed to them being parameterized. See:
Great finding! That timeout=2
is very hidden.
Occasionally, I'm getting timeouts:
It's possible that current default learning delay of 2 seconds is too short. See:
https://github.com/nucypher/nucypher-porter/blob/799a08ce833bf16dd6c2a867be4e60dba1faf103/porter/main.py#L49