Skip to content

bug in retry code for Star Fragment Lamp #2444

Open
@jdimpson

Description

@jdimpson

I believe there is a bug in the retry code used get_request() in the Star Fragment Lamp code.

The retry code at line 65 (

) is:
n = ping
This simply assigns the value of ping to the variable n. It does not invoke ping. It should be:
n = ping()

The reason the code appears to work is that the retry code is called like this (on line 78 and at least one other location):
now = get_request(5, io.receive_time())

Specifically, io.recieve_time() is being invoked before get_request(). The result of io.recieve_time() is then being passed into get_request() as the value for ping, which as shown above simply copies that value into n, which it then returns as the result of get_request(). So io.recieve_time() is being invoked outside of the retry code in get_request(), which mean it doesn't benefit from any retries. Instead, get_request() should be invoked like this:
now = get_request(5, io.receive_time)

This passes a reference to the io.recieve_time() as the value of ping, which with the change I suggest above, will then be invoked inside the retry loop in get_request.

(Edit: formatting typo)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions