Opened 3 years ago

Closed 3 years ago

#2226 closed defect (fixed)

Problems to abort "File import" plug-in when import URLs

Reported by: Nicklas Nordborg Owned by: everyone
Priority: major Milestone: BASE 3.17.1
Component: coreplugins Version:
Keywords: Cc:

Description

Aborting a job that is importing File items that are URL links seems to be impossible. The status will change to "Aborting" but the plug-in continues to parse the file until the end.

This is similar to the problem in #2059.

In the file importer plug-in there is a call to File.updateURLMetadata() that is surrounded by a try/catch block that ignore all exception. It could be that this method uses most of the time since it has to connect to the remote server and get information about the file. Since the "Abort" functionality is implemented by sending an "interrupt" signal to the thread it is likely that this simply causes an abort of the remote connection and in our code we ignore this in the try/catch.

So, the abort will only result in a single file item doesn't get any metadata.

Change History (1)

comment:1 by Nicklas Nordborg, 3 years ago

Resolution: fixed
Status: newclosed

In 7875:

Fixes #2226: Problems to abort "File import" plug-in when import URLs

The File.updateURLMetadata() has been updated to detect and handle the case when the connection to the remote server is interrupted. It turned out that there was at least two possible cases (when tested with the sftp protocol in the Xfiles extension). Both cases can be handled by searching for either InterruptedException or InterruptedIOException in the stack trace.

Note: See TracTickets for help on using tickets.