Skip to content

Commit

Permalink
Fix upload thread creation timing issue (s3ql#240)
Browse files Browse the repository at this point in the history
If the block cache is initialised (i.e. associated threads created, with
references to trio channels) before daemonisation, those threads end up
running in a separate process to the main trio code and thus
sending/receiving on two unrelated/"disconnected" channels.

Fix this by moving initialisation back after daemonisation, as was the
case before the commit in fbd3116
  • Loading branch information
r0ps3c authored and Nikratio committed Jan 22, 2021
1 parent c61b8ca commit 4e8667c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ UNRELEASED CHANGES

* The tcp-timeout backend option of the B2 Backend works now.

* mount.s3ql no longer crashes with "No Upload Threads available" when not running in
foreground.

2021-01-03, S3Ql 3.7.0

2021-01-03, S3QL 3.7.0

* S3QL now requires Python 3.7 or newer.

Expand Down
3 changes: 2 additions & 1 deletion src/s3ql/mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,6 @@ async def main_async(options, stdout_log_handler):
async with AsyncExitStack() as cm:
block_cache = BlockCache(backend_pool, db, cachepath + '-cache',
options.cachesize * 1024, options.max_cache_entries)
block_cache.init(options.threads)
cm.push_async_callback(block_cache.destroy, options.keep_cache)

operations = fs.Operations(block_cache, db, max_obj_size=param['max_obj_size'],
Expand Down Expand Up @@ -240,6 +239,8 @@ def unmount():

mark_metadata_dirty(backend, cachepath, param)

block_cache.init(options.threads)

nursery.start_soon(metadata_upload_task.run, name='metadata-upload-task')
cm.callback(metadata_upload_task.stop)

Expand Down

0 comments on commit 4e8667c

Please sign in to comment.