Skip to content
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

adds latest flag to get timestamps when roots expire #500

Merged
merged 6 commits into from
Aug 16, 2024

Conversation

akhileshh
Copy link
Contributor

@akhileshh akhileshh commented Jun 11, 2024

@ceesem
Copy link
Collaborator

ceesem commented Jun 13, 2024

Hm, I'm not sure if this is working.

I added a latest and timestamp parameter to a caveclient branch and am getting the following error:

from caveclient import CAVEclient, chunkedgraph

cmain = CAVEclient('minnie65_phase3_v1')

ltv5_server_address = "https://ltv5.microns-daf.com"
pcg_client = chunkedgraph.ChunkedGraphClient(
    server_address=ltv5_server_address,
    auth_client=cmain.auth,
    table_name=cmain.chunkedgraph.table_name
)

pcg_client.get_root_timestamps([864691135565770007, 864691135837393555], latest=True)

responds with

500 Server Error: pop from an empty deque for url: https://ltv5.microns-daf.com/segmentation/api/v1/table/minnie3_v1/root_timestamps?latest=True

Traceback (most recent call last):

  File "/app/venv/lib/python3.11/site-packages/flask/app.py", line 1484, in full_dispatch_request
    rv = self.dispatch_request()
     ^

  File "/app/venv/lib/python3.11/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
                                                                        ^

  File "/app/venv/lib/python3.11/site-packages/middle_auth_client/decorators.py", line 296, in decorated_function
    return f(*args, **kwargs)
     ^

  File "/app/venv/lib/python3.11/site-packages/middle_auth_client/decorators.py", line 418, in decorated_function
    return f(*args, **kwargs)
     ^

  File "/app/pychunkedgraph/app/app_utils.py", line 50, in decorated_function
    return f(*args, **kwargs)
     ^

  File "/app/pychunkedgraph/app/segmentation/v1/routes.py", line 537, in handle_root_timestamps
    root_timestamps = common.handle_root_timestamps(
                                                   ^

  File "/app/pychunkedgraph/app/segmentation/common.py", line 1101, in handle_root_timestamps
    result.append(new_roots_ts.popleft())
                   ^

IndexError: pop from an empty deque

The same thing works as expected with latest=False.

@fcollman
Copy link
Collaborator

I think this doesn't error nicely if you pass a latest=True and a timestamp that is before when the root_id was created. Also we should have a PCG 1.0 version of this PR.

@akhileshh akhileshh merged commit 8a3bad8 into main Aug 16, 2024
1 check passed
@akhileshh akhileshh deleted the root-timestamps-latest branch August 16, 2024 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants