Don't pre-convert all serverids to ServerTrackers #2119

Open
opened 2013-11-27 21:04:39 +00:00 by markberger · 2 comments

In immutable/upload.py we have the following code:

    def _get_next_allocation(self):
        """
        Return the next share allocation that we need to make.

        Specifically, I return a tuple (tracker, shares_to_ask), where
        tracker is a ServerTracker instance and shares_to_ask is a set of
        shares that we should store on that server. If there are no more
        allocations to make, I return None.
        """

        while self.trackers:
            tracker = self.trackers.pop(0)
            # TODO: don't pre-convert all serverids to ServerTrackers
            assert isinstance(tracker, ServerTracker)

As part of #1382 I am removing the TODO comment and creating a ticket for it instead.

In `immutable/upload.py` we have the following code: ``` def _get_next_allocation(self): """ Return the next share allocation that we need to make. Specifically, I return a tuple (tracker, shares_to_ask), where tracker is a ServerTracker instance and shares_to_ask is a set of shares that we should store on that server. If there are no more allocations to make, I return None. """ while self.trackers: tracker = self.trackers.pop(0) # TODO: don't pre-convert all serverids to ServerTrackers assert isinstance(tracker, ServerTracker) ``` As part of #1382 I am removing the TODO comment and creating a ticket for it instead.
markberger added the
unknown
normal
defect
1.10.0
labels 2013-11-27 21:04:39 +00:00
markberger added this to the undecided milestone 2013-11-27 21:04:39 +00:00

So, why not convert all serverids to ServerTrackers right away? Looking at the code for ServerTracker, it doesn't look like creating it has any problematic side-effects or uses up major resources, so unless there's something I didn't notice, I propose we just close this ticket as wontfix. Re-assigning to markberger to explain why this would be better.

By the way, good job cleaning up the TODOs out of the source code! ☺

So, why *not* convert all serverids to ServerTrackers right away? Looking at the code for ServerTracker, it doesn't look like creating it has any problematic side-effects or uses up major resources, so unless there's something I didn't notice, I propose we just close this ticket as `wontfix`. Re-assigning to markberger to explain why this would be better. By the way, good job cleaning up the TODOs out of the source code! ☺
Author

It wasn't clear to me why someone left the comment either, but I decided to open a ticket just in case. I'm also fine with marking it as wontfix.

It wasn't clear to me why someone left the comment either, but I decided to open a ticket just in case. I'm also fine with marking it as `wontfix`.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Reference: tahoe-lafs/trac-2024-07-25#2119
No description provided.