[sword-devel] Abort module installation via API + Custom network timeouts

Tobias Klein contact at tklein.info
Sat Aug 8 05:37:51 EDT 2020

On 8/8/20 10:54 AM, Jaak Ristioja wrote:
> On 08.08.20 10:30, Tobias Klein wrote:
>> Is there a way to abort a module installation via the SWORD API?
>> I saw in InstallMgr::installModule that there is some handling for when
>> the user aborted the process. But it doesn't seem like this is
>> controlled via the API.
> "Yes" - see the bool term member of the RemoteTransport class.
> Does it work properly? - No, because the change to the regular bool
> member might not reach the other execution thread due to caching etc CPU
> effects. Sword++ switched to std::atomic<bool> to fix this case:
> https://github.com/swordxx/swordxx/commit/b253a8888c1dc683ea93b38efce0f6113dea9b47
> There is a similar issue regarding aborting of indexing.


@Troy: Would it be possible to include this kind of fix in SWORD?

>> One typical use case would be that the user's download speed is
>> currently slower then acceptable (whether due to internet issues or
>> server issues). In this case, instead of waiting "forever" one may want
>> to abort a download/installation.
> Network issues (connections hanging etc) is how we first discovered this
> issue with BibleTime long time ago. The user gets stuck in the download
> dialog and had no means even to navigate away from it. The only possible
> way is to kill the offending BibleTime process.
>> Also, another question in the same context: Is it possible to configure
>> a custom timeout for the download of modules? What happens if a
>> repository server goes down? I remember one time when the Xiphos repo
>> was not available, waiting times seemed to be too long in the frontend
>> (based on long default timeouts in SWORD?).
> As far as I know it is currently not possible to configure a timeout, so
> it might just hang indefinitely. ;-(

I suppose the timeout is configured somewhere already, but just not 
configurable through the API at the moment.

@Troy: Would it be possible to add a timeout parameter directly to 
"installModule" and then pass it through to the right place? Or 
alternatively configure it with a setter on InstallMgr?

Best regards,

More information about the sword-devel mailing list