Skip to content

Cancel obsolete requests#268

Closed
m-novikov wants to merge 5 commits intoilastik:mainfrom
m-novikov:cancel-tiles-volumina
Closed

Cancel obsolete requests#268
m-novikov wants to merge 5 commits intoilastik:mainfrom
m-novikov:cancel-tiles-volumina

Conversation

@m-novikov
Copy link
Copy Markdown
Contributor

No description provided.

@m-novikov m-novikov force-pushed the cancel-tiles-volumina branch from 7fae009 to e51cc5f Compare January 25, 2021 08:47
@m-novikov m-novikov force-pushed the cancel-tiles-volumina branch from e51cc5f to c1bc989 Compare January 25, 2021 08:48
@m-novikov m-novikov marked this pull request as ready for review January 25, 2021 08:51
@m-novikov m-novikov force-pushed the cancel-tiles-volumina branch from a99e024 to 386d3ea Compare January 27, 2021 09:04
@m-novikov m-novikov force-pushed the cancel-tiles-volumina branch from 386d3ea to 4e58dfb Compare January 27, 2021 09:10
stack_id = stack_id or self._current_stack_id
tile_nos = self.tiling.intersected(rectF)
to_cancel = self._current_requests
self._current_requests = {}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Volumina's code is kinda hard to navigate, so I'd love to see some type annotations like

self._current_requests: Mapping[Tuple[LAYER_ID, ImageSource, REQUEST_ID], ArrayRequest] = {}

else:
ims_req.cancel()

self._current_requests.pop((stack_id[1], ims, tile_nr), None)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you using pop here because the request might have been already removed from self._current_requests?

This kinda makes me think if it would be possible for a request to overwrite an older one; If I, say, load an image in a layer, make a request, drop that layer, then load another image and make another request, is it possible for the second request to overwrite the previous one? Even worse, is it possible for the second one to be cancelled when we meant to cancel the first?

@k-dominik
Copy link
Copy Markdown
Contributor

closed in favor of #339

@k-dominik k-dominik closed this Oct 16, 2025
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