View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000494aMuleSharedfilespublic2005-06-29 14:162005-07-05 12:29
Reportereyalzo 
Assigned ToXaignar 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version2.0.3 
Target VersionFixed in VersionSVN 
Summary0000494: Clients with score zero stay in queue
DescriptionSome clients in upload queue might get score of zero, and stay there (almost) forever. It makes all the new uploaders to get into queue, even when there are some empty slots waiting for them.
Additional InformationThe problem is that direct-add is used only when upload-queue is empty. But it won't be empty if these guys won't get their slot or kicked-out.
It can be solved in one of several ways. I decided to give them a slot.
The easiest way is to change UploadQueue.cpp, AddUpNextClient(), the line:

if ( cur_score > bestscore){

To:

if ( cur_score >= bestscore){

You can also use signed-int for bestscore, and start with -1.
TagsNo tags attached.
Fixed in Revision
Operating System
Attached Files

- Relationships

-  Notes
(0001122)
Xaignar (manager)
2005-07-05 12:29

Thanks you for the report. The following fix has been applied:

===================================================================
--- src/UploadQueue.cpp (revision 4715)
+++ src/UploadQueue.cpp (working copy)
@@ -80,11 +80,13 @@
        m_lastCalculatedDataRateTick = 0;
 }
 
-void CUploadQueue::AddUpNextClient(CUpDownClient* directadd){
+
+void CUploadQueue::AddUpNextClient(CUpDownClient* directadd)
+{
        POSITION toadd = 0;
        POSITION toaddlow = 0;
- uint32 bestscore = 0;
- uint32 bestlowscore = 0;
+ sint64 bestscore = -1;
+ sint64 bestlowscore = -1;
 
        CUpDownClient* newclient;
        // select next client or use given client
@@ -113,8 +115,9 @@
                                continue;
                        }
                        // finished clearing
- uint32 cur_score = cur_client->GetScore(true);
- if ( cur_score > bestscore){
+
+ sint64 cur_score = cur_client->GetScore(true);
+ if (cur_score > bestscore) {
                                bestscore = cur_score;
                                toadd = pos2;
                        } else {
===================================================================

Cheers,
 Xaignar

- Issue History
Date Modified Username Field Change
2005-06-29 14:16 eyalzo New Issue
2005-07-05 03:28 Xaignar Status new => acknowledged
2005-07-05 12:29 Xaignar Status acknowledged => resolved
2005-07-05 12:29 Xaignar Fixed in Version => CVS
2005-07-05 12:29 Xaignar Resolution open => fixed
2005-07-05 12:29 Xaignar Assigned To => Xaignar
2005-07-05 12:29 Xaignar Note Added: 0001122


Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker