Opened 7 months ago

Last modified 3 months ago

#5183 reopened defect

Make interface of FileSystem asynchronous

Reported by: sergz Assignee:
Priority: P2 Milestone:
Module: Libadblockplus Keywords:
Cc: fhd Blocked By: #5179, #5508
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

https://codereview.adblockplus.org/29449592
https://codereview.adblockplus.org/29499574/
https://codereview.adblockplus.org/29499592/
https://codereview.adblockplus.org/29535572/

Description

Background

It would be useful to provide users of libadblockplus with possibility to use their own scheduler for asynchronous operations. It's useful because, e.g. on MS Windows only one worker thread is enough to support all our asynchronous operations. In order to do it we should make the methods of injected interface of FileSystem asynchronous. All asynchronous operations should be cancelled when the implementation is destroyed (in particular by JsEngine).

In addition it fixes #3595 by design.

What to change

  • Add interface of FileSystem with asynchronous methods.
  • For default implementation use asynchronous executor from #5179 and allow to inject current synchronous implementation to the default async implementation. The latter will allow users of libadblockplus to continue to use their current implementation.
  • make corresponding changes in JsEngine and tests.

Change History (12)

comment:1 Changed 6 months ago by hfiguiere

  • Owner set to hfiguiere

comment:2 Changed 6 months ago by hfiguiere

  • Review URL(s) modified (diff)
  • Status changed from new to reviewing

comment:3 Changed 5 months ago by abpbot

A commit referencing this issue has landed:
Issue 5183 - Provide async interface for FileSystem

comment:4 Changed 5 months ago by hfiguiere

  • Status changed from reviewing to reopened

Issue #5179 is still blocking this.

comment:5 Changed 4 months ago by sergz

  • Owner changed from hfiguiere to sergz

I'm updating tests to get rid of race conditions related to threads in file system implementation, removing synchronous FileSystem interface and moving headers for DefaultFileSystem into src directory.

comment:6 Changed 4 months ago by sergz

  • Review URL(s) modified (diff)

comment:7 Changed 4 months ago by abpbot

A commit referencing this issue has landed:
Issue 5183 - don't inherit ThrowingFileSystem from sync FileSystem

comment:9 Changed 4 months ago by sergz

  • Owner sergz deleted

Basically this issue can be considered as finished because currently a user can already provide with the proper implementation, however the default implementation is still using detached threads, that's blocked by #5179. Current implementation accepts a scheduler function which after #5179 should use the scheduler.

comment:10 Changed 3 months ago by sergz

  • Blocked By 5508 added

comment:11 Changed 3 months ago by sergz

  • Review URL(s) modified (diff)

comment:12 Changed 3 months ago by abpbot

A commit referencing this issue has landed:
Issue 5183 - make FileSystemPtr std::unique_ptr

Note: See TracTickets for help on using tickets.