1473: TerminateThreads does not finish cleanly [#9229]

Post a reply

Smilies
:D :) :( :o :-? 8) :lol: :x :P :oops: :cry: :evil: :roll: :wink:

BBCode is ON
[img] is ON
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: 1473: TerminateThreads does not finish cleanly [#9229]

Re: 1473: TerminateThreads does not finish cleanly [#9229]

by markstuartwalker » Sat May 12, 2012 3:26 am

Tested MM 4.0.5.1489 and this seems to fix the problems. :-) The sync message is removed immediately, the sync can be re-attempted and if MM closes it no longer reports that there are background running tasks.

Thank you.

Re: 1473: TerminateThreads does not finish cleanly [#9229]

by markstuartwalker » Thu May 10, 2012 11:35 am

Ok. ALL of my code runs under the sync so I thought that was pretty obvious. I described this as a suicide call.

I look forward to the next release.

Re: 1473: TerminateThreads does not finish cleanly [#9229]

by Ludek » Tue May 08, 2012 5:58 pm

markstuartwalker wrote:Misunderstanding. My plugin has an addition check for more than 5% of the files being deleted. It's dialogue is what I refer to and not the mm one.

Plugin can be downloaded from the mm site
Aha then, that was really misunderstanding.

The deadlock here was caused by the fact that you called TSDBDevice.TerminateThreads() function from the thread that was about to terminate, and there was waiting for the termination in the TSDBDevice.TerminateThreads()

I removed the waiting from the TSDBDevice.TerminateThreads() function, will be fixed in build 1489.

Re: 1473: TerminateThreads does not finish cleanly [#9229]

by markstuartwalker » Tue May 08, 2012 11:40 am

Misunderstanding. My plugin has an addition check for more than 5% of the files being deleted. It's dialogue is what I refer to and not the mm one.

Plugin can be downloaded from the mm site

Re: 1473: TerminateThreads does not finish cleanly

by Ludek » Mon May 07, 2012 5:47 pm

markstuartwalker wrote:Sorry for the delay. I've tested with 1486. The problem is still there.

The sync message remains on screen. When closing MM it says there are background tasks. Need to forcibly close using Task Manager.

Mark, strange, I can no longer replicate anything like this after the fix.

Maybe there is a misunderstanding, do we both think the "Delete from device" dialog saying:
"The following X items on youre device ...... Do you want to remove them from the device?" and there are buttons
[Continue] [Cancel]

you click [Cancel] and are you saying that the problem described by you appears?

It shouldn't get into DEVICE_DeleteFiles if you clicked [Cancel], so you clicked [Continue]?

And even if I click [Continue] and put TerminateThreads() into the DEVICE_DeleteFiles() I can no longer reproduce the issue in 1486.
Please re-test or send me your plugin to reproduce.

Re: 1473: TerminateThreads does not finish cleanly

by markstuartwalker » Fri May 04, 2012 1:57 am

Sorry for the delay. I've tested with 1486. The problem is still there.

The sync message remains on screen. When closing MM it says there are background tasks. Need to forcibly close using Task Manager.

Re: 1473: TerminateThreads does not finish cleanly

by rusty » Fri Apr 27, 2012 8:52 am

Hi Mark,

Can you confirm that this is working for you as expected in build 1484?

Thanks.

-Rusty

Re: 1473: TerminateThreads does not finish cleanly

by markstuartwalker » Fri Apr 13, 2012 10:16 am

I've checked build 4.0.5.1481. I have a slightly modified test case that doesn't work.

* Sync 20 tracks.
* Change the auto sync list so only 10 tracks will remain.
* Sync and see the "10/20 of the tracks are to be deleted. Continue to delete?" message appearing.
* Select "No"

This causes the TerminateThreads function to be called from within the DEVICE_DeleteFiles() function. Result is that the "Removing old content" message remains forever.

When finally MM is manually closed it says that there are background tasks running.

Re: 1473: TerminateThreads does not finish cleanly

by markstuartwalker » Mon Mar 26, 2012 2:51 am

When might I get visibility of this release for testing?

Re: 1473: TerminateThreads does not finish cleanly

by Ludek » Thu Mar 22, 2012 11:18 am

Re: 1473: TerminateThreads does not finish cleanly

by Ludek » Thu Mar 22, 2012 11:11 am

You seem to be true that MediaMonkey should check more often whether the thread is about to be terminated and to terminate it ASAP.

I will fix it.

1473: TerminateThreads does not finish cleanly [#9229]

by markstuartwalker » Thu Feb 16, 2012 10:16 am

This is an old issue from http://www.mediamonkey.com/forum/viewto ... ds#p317810

I thought that I'd covered this off already but recent testing in another area I revealed that it does terminate but it leaves the current message on the status bar.

For example, if I call this from within DEVICE_GetFlag via the dflFullSynchStart constant it leaves the message "Synchronising d_itunes4.dll on xxxxx: (preparing list of files)". Terminating the thread ought to clear the message too.

In Delphi I can see a repeating message "Waiting for SyncroniseDevice thread to terminate" message. Further, if MM is closed in this state it says that there are background tasks running.

... or perhaps we ought to terminate device synchronisation more cleanly than just killing the tasks.

Top