Fix serve registration crash on 0.7.61: node_hmac_key is a property, not a method#11
Open
shaal wants to merge 1 commit into
Open
Fix serve registration crash on 0.7.61: node_hmac_key is a property, not a method#11shaal wants to merge 1 commit into
shaal wants to merge 1 commit into
Conversation
cli.py:1232 called node.node_hmac_key() but node_hmac_key is a @Property (node.py:674), so it raised "TypeError: 'str' object is not callable". That exception is caught by the registration try/except and logged as "Registration attempt failed"; all 3 retries hit the same deterministic error and the node never reaches a registered client state, so heartbeats stop landing and the directory marks it offline (available:false, health:0) within ~30s even though the process is still running and the HTTP register succeeded server-side. Drop the call parens so the property value is read instead of invoked. Fixes RobLe3#10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10.
cli.py:1232(the#456 / TC-9ctoken/HMAC cache block) callsnode.node_hmac_key(), butnode_hmac_keyis a@property(node.py:674)that returns a
str. Invoking it raisesTypeError: 'str' object is not callable.Because that call sits inside the registration
try/except, the error iscaught and logged as
Registration attempt failed; all 3 retries hit the samedeterministic error, and the node never reaches a registered client state. Its
heartbeats then stop refreshing the directory and it is marked offline
(
available:false,health:0) within ~30s — even though the process is stillrunning and the HTTP registration succeeded server-side (token returned,
operator delegation accepted). 0.7.48 is unaffected.
Fix
Read the property instead of calling it:
Test
Follow-up (not in this PR)
This cache step is described in-code as "best-effort", but it runs inside the
registration
try/except, so any error here aborts an otherwise-successfulregistration. Wrapping just the cache step in its own
try/except Exception: passwould make a future caching bug non-fatal to registration.