-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Fix timelord closing. #10630
Fix timelord closing. #10630
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
This still needs a look @mariano54 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really understand this change & this code TBH. We should make sure that when we deploy, we have some old timelords running as well.
if chain not in self.unspawned_chains: | ||
self.unspawned_chains.append(chain) | ||
if chain in self.chain_type_to_stream: | ||
del self.chain_type_to_stream[chain] | ||
del self.chain_type_to_stream[chain] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we are not checking inclusion anymore. Is that intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should always be included at this point - in case it's not we have no writer to close, it'll just log the error (but I don't think it ever gets to this point).
@@ -183,25 +183,22 @@ async def _handle_client(self, reader: asyncio.StreamReader, writer: asyncio.Str | |||
|
|||
async def _stop_chain(self, chain: Chain): | |||
try: | |||
while chain not in self.allows_iters: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we removing the while loop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to avoid the infinite loop that happens in rare cases (written in the description).
Attempt to fix the infinite loop
Trying to stop {chain} before its initialization.
if we try to close a chain that's not inself.allow_iters
.