hougaard / BCCL_support

BCCL Support Repository
3 stars 0 forks source link

BCCL.registration.dat is used by another process #6

Closed StefanMaron closed 3 years ago

StefanMaron commented 3 years ago

Describe the bug I did a bit of stress testing with the client. When I do getdata asynchronously I get an error that the BCCL.registration.dat is used by another process. It seems like this file gets opened with every command.

To Reproduce with this python script you can reproduce the error

import subprocess
import json

p = subprocess.Popen(['BCCL', '-t', 'tables'], stdout=subprocess.PIPE)

out = p.stdout.read()
tables = json.loads(out)
tables = tables["Tables"]

basepath = 'C:\\Temp\\BCCLTEST\\'

for table in tables:
    p = subprocess.Popen(['BCCL', '-t', 'getdata', '-s', 'table={0}'.format(
        table['No']), '-o', '{1}.json'.format(basepath, table['Name'])], shell=True)

Even if I add a sleep(0.1) the error sometimes appears.

Expected behavior It would be nice if we could maybe pass the registration key with every command to avoid this error and be able to do this kind of mass export/import

Screenshots image

Desktop (please complete the following information):