File read error: Thread was being aborted
Author: Ben_Zurich
Creation Date: 6/27/2014 11:32 AM
profile picture

Ben_Zurich

#1
Since we have installed a fast 64bit system with WL6.6.13.0 (64 bit), occasionally we experience a file read error at "GetExternalSymbol()" or "BlmbrgF.Series()". These errors do not show on our 32 bit system with WL6.4.0.49 (32 bit). For instance, we get a window like

QUOTE:
[ReadFundamentalFile] file read error
File: X:\0_bdat\ ... <filename>.wlc or <filename>.wl
Thread was being aborted


which disappears when our batch processing advances.

This looks like a problem originating at our side. However some facts about this error are puzzling me.
First of all, it always happens with another file and almost never with the same file again.
Secondly, WL6 pushes an error and it looks different each time:

CODE:
Please log in to see this code.


CODE:
Please log in to see this code.


CODE:
Please log in to see this code.


CODE:
Please log in to see this code.


It looks to me that the file has being read but is corrupted or not complete.
Any help is appreciated.
profile picture

Eugene

#2
I recall that you developed some complex solution in the past. As far as some batch processing is concerned, you should know that not all aspects of WealthLab are thread-safe. I believe this error message may be by design, preventing a conflict caused by accessing the same data file. (For streaming strategies, there actually is a built-on protection to avoid a crash when an end-of-interval interrupt occurs while the strategy is already executing.)

Not knowing the specifics of your batch processing code, is it Streaming or not, whether does it use locking to restrict code from being executed by more than one thread at the same time etc., I can only suggest to experiment with adding a delay before calling methods like GetExternalSymbol, SetScaleDaily, GetAllDataForSymbol etc. like this KB article illustrates:

FAQ > What is optimal for my trading, Strategy Monitor or Strategy window?
profile picture

Ben_Zurich

#3
Thank you for your answer.

We do not employ intraday (streaming) data nor do we trade with WL6. It's all historic daily data.

Also, we only have one instance of WL6 open at any time.

It is not possible that the .WL or .WLC files that we acces are blocked by any other program accessing them.

As far as I am aware of it, I am not accessing GetExternalSymbol() concurrently in two or more different threads.

So I am not sure why this at alll can happen.

Anyway I will try to insert delays of 100ms before GetExternalSystem() and BlmbrgF.Series() and look what happens.
profile picture

Ben_Zurich

#4
I have now a case where the thread was aborted while executing the very first call of GetExternalSymbol() in the strategy.
profile picture

Ben_Zurich

#5
I have inspected all these conditions from the past several days and found that it does not happen with GetExternalSystem() all the time (although most of the time), but occasionally also at the following statments:
CODE:
Please log in to see this code.


This is more and more puzzling.
profile picture

Eugene

#6
Try catching that exception and ignoring it gracefully. Mind the time consuming, long-running code: aborting the thread may be a hint that a timeout occurs. Other than that I can neither give any further advice (as I'm not familiar with your code or workflow in general) nor troubleshoot your custom code.

For the record, which provider's data does your GetExternalSystem() access? Always Bloomberg?
profile picture

Ben_Zurich

#7
WealthLab.DataProviders.Blmbrg.dll
WealthLab.DataProviders.AsciiFilesStatic.dll
profile picture

Eugene

#8
ASCII files can be written by external applications. This is a typical scenario.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).