Aborting downloads = paused



  • Sometimes aborting downloads results in the status being changed to paused and being unable to clear list - even clicking the trash icon doesn't clear it, I have to restart HISE.

    e4c8e681-e33c-4280-a1f1-26c2694b343b-image.png



  • This post is deleted!


  • I can see the abort command triggers the stop command. So I'm guessing that since the download is paused it never reaches the isFinished state and won't be cleared from the download queue.



  • Here's a test snippet that demonstrates the issue. Press start to begin downloading a 100mb file. Press stop to abort the download. You'll see the download is paused, the file is deleted, but the paused/aborted download list never clears and won't clear even when pressing the clear button. In my real project the file occassionaly isn't deleted either, I'll try and recreate this in another snippet.

    This problem also happens with the pause and abort control in the server control panel.

    HiseSnippet 1205.3ocsW01aaaCDlxIJqx6ErNr8cA+IEfDE6sztgMLrTaGO3s3Ti31h8gBzQKQGSDIRARpz5EDf8Sa+j1+fsiTuFGGmLiE+Ic7ti74d3w6NOVvCHRIWfrbd0hDBx5Srmrfol2aNlxPC6ir9Ja7TtPseH+8rHNNbeEQpPcWjfkRRHxxZqeVapky1Hyu+9m5hivr.R0RHza3z.xIzXppZ0wG8qznnA3Pxqnw0r9viFFvY83Q7T.VaY2FkfCt.eN4Tr1rF1HqcNNjp3hIJL.Fj01c4gKlLG.Xl8ugJoSiHZgNnIvFks7.dTnFw5UQ8lSiBGWD9RDrKiqHisxHiuzdDMjVtdEo74FEtUdTmOrZrN30oN7Z+vgmUM3scF7dp8j.AMQUoQisO1dHSQDyvvUPcXkYKpwWricONXAS4GiufLP.Bkd3871s2y8Ysau6OzrIbMHUtJr3bhx8GcGPiHSVHUjXeXACbEd0VredFhrx2TQD3Xq4JUx2evAzjKOzuHOxWMmxtXp.9bJlE5GviOnS61i55+GzjVvNLgHtjH7kD0oowuHJh+dRX4Q30Y2aXRWrj75yNwq3nZoUKHm6Vbbf3rTVfhxYkq0CGEMExs71s4UMcnyb8.LI8CwJr+LJiJmSB2soCny4X14TFwWB2hi.pFxF8ZMH2D8Y4bcyqa17fCbmpXv8tPkS.Eh.KTP5.20iGmvYffWqBCzaRw25.RasfGUBQNqPatFc.RYQ.pbKCraYjWPwIsm6k3nTRYjlK4bkCDcQ7.bj6L.jYW1FLpy.02tdszu3M2J5.0of8.qy4+hULVCW49BRRjNYp51XO2qtdO2Y6cKt+VbGOoN0wSVOywSJINdxZ3Mdx8Sak17.XMfGzxkIyT4YoLFkct2tf5JRx2T7zaonbLNURpBSi35hSiA4Ap466LRMZuuPstQ+eFqRfBMgpCIBBHsSTYeB7ThDV59R9HHxzXxxDTuHBVTQPFw0QPFCxIHy22IAYzdeDTcidXDT9Kg.vQVQcgphU4QWsC4Tth7RVVgGHrcWV0rYqTWNlhfBuqRstQpXcN5wRimRD0iDsgPGka1xx9taYUuiZP18QMC4rgLp5kID1c0HCkeIBe85g8gRs5da4qA1kPDJpFBV8IWBCMj0oywtOQdAjdAHs7lGY8DkQ6mk2GrapRwYHJztqocQkPzGfvwxGNtEUyX7KGoHe.1fOxNyFI9RxP1XHYjnz8JoxQ7X3HvBvIqFDFFhdcK+SfDCl1BzCBFN14UVVEJ9y2lihcrMl7XABCWXdyuJT76yJ4hLaVFFq3bWBY+Gfg4k0pfwewJgQlMa.ab6Ijf4z3goQX0MGdSOwZtB34wMlRROIDSRUKpOQ6ixDcOT39T6wTUv7Ui2Fq.uvCpGa7lOe7mZe7rYj.UEX21dvu83OLL5LdpBZ.MBqDTcxDLg3D3uKDP.jvXP2GcBVCcwlL41ZYMyLgvBMB+C7KWYGsrUtxNEJQw3.A+cAYEN0Sf+DyJ.lXl+Hhi8HsraGjoXJ3mca+1nXHk7cAAZpXe.6q1mudC74a1.eNbC74YafOOeC74a2.e9t05itZvKRU73rmIvBiO1zgwx5XS4BSFI5eko4iwC
    


  • Bump bump - the snippet in the last post demonstates the issue.



  • @d-healey Hi, I tried your snippet and faced the same issue. I wish I could be of some help but I didn't find any solution.
    As you said it seems that the file won't be cleared if its state is not set to 'isFinished'.

    I recently watched your c++ tinkering video and started to take a look at HISE's source code, so here it is :
    Tell me if I'm completely wrong, but in ScriptingApiObjects.cpp line 649 is this function :

    bool ScriptingObjects::ScriptDownloadObject::abort()
    {
    	shouldAbort.store(true);
    	return stop();
    }
    

    Wouldn't it be possible to add something like that to set the aborted download to Finished ?

    data->setProperty("finished", true);
    

    Really I don't know c++, I'm just taking a shot here 😅



  • Thanks Matt, I already had a look at the C++ myself but I quickly got lost. The abort function calls the stop function which triggers the pause action and some other stuff. I shall wait for master Christoph 🙂



  • @d-healey said in Aborting downloads = paused:

    I already had a look at the C++ myself but I quickly got lost.

    I thought you did. I ended up a bit lost too among these functions 😆



  • @d-healey Just examined the source, it appears that abort is just a stop with delete file. I partly fixed it but the callback's still fired every 500ms... Will tell if I get somewhere 😉

    EDIT sorry I started the message long ago so I haven't seen you looked at the code already 🙂



  • I should add that everything works if you call a clean after abort. so it is usable with a simple fix.
    But it would be better handled automatically. Having a look...



  • Another problem, with a bad connection, the download often passes to "finished" state, with no resume option (except clean and start again). A timeout safety could be good, like waiting 10sec before declaring a download stopped (so internally it is not finished and could be resumed manually after fixing the "bad connection))



  • Bump bump @Christoph-Hart 🙂



  • @ustk Is this issue solved by your pull request?



  • @d-healey Yes it should be.



  • @ustk Excellent, I'll try it out!



  • @ustk Yeah that works great, thanks!


Log in to reply
 

17
Online

1.6k
Users

4.6k
Topics

42.5k
Posts