Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Occasional fwrite errors using file-based stores #381

Open
zfj1 opened this issue Oct 2, 2021 · 0 comments
Open

Occasional fwrite errors using file-based stores #381

zfj1 opened this issue Oct 2, 2021 · 0 comments
Labels
awaiting-triage Issues awaiting proper priority/milestone assignment. bug

Comments

@zfj1
Copy link

zfj1 commented Oct 2, 2021

Bug Report

Description

Inserting into a store using the file protocol occasionally causes an error in fwrite.

Reproducibility

  • OS WIN
  • MATLAB Version 2020b
  • MySQL Version 8.0.20
  • MySQL Deployment Strategy remote
  • DataJoint Version 3.4.1
  • Minimum number of steps to reliably occasionally reproduce the issue:
my_schema.MyStoreBasedTable().insert({'my_pk', 'my_blob'});
  • Complete error stack as a result of evaluating the above steps:
Error using fwrite
Invalid file identifier. Use fopen to generate a valid file identifier.

Error in dj.store_plugins.File.upload_buffer (line 57)
            fwrite(fileID, buffer);

Error in dj.internal.ExternalTable/upload_buffer (line 116)
            self.spec.upload_buffer(packed_cell{1}, self.make_uuid_path(uuid, ''));

Error in dj.Relvar/insert/makePlaceholder (line 420)
                        value = self.schema.external.table(...

Error in dj.Relvar/insert (line 499)
                    [v, placeholder] = makePlaceholder(i, tuple.(header.attributes(i).name));

Expected Behavior

Successful insertion

Screenshots

N/A

Additional Research and Context

This often happens in the middle of inserting many entries into a store-based table, causing the transaction to fail. It then will often work after re-running the insertion.

Our store is on a mounted network drive, so it's possible that momentary disconnections from the file server are at play, but I would think this is probably a common use case. (Note that our file server and db server are on the same network). A simple solution may just entail retrying the file creation on failure.

It would also be convenient to disable the 'directory already exists warning' using warning('off','MATLAB:MKDIR:DirectoryExists')

@zfj1 zfj1 added awaiting-triage Issues awaiting proper priority/milestone assignment. bug labels Oct 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting-triage Issues awaiting proper priority/milestone assignment. bug
Projects
None yet
Development

No branches or pull requests

1 participant