Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Possible asynchronous bug in NetworkOperationsHandlerImpl . #23

Open
gmpassos opened this issue May 5, 2021 · 1 comment
Open

Possible asynchronous bug in NetworkOperationsHandlerImpl . #23

gmpassos opened this issue May 5, 2021 · 1 comment

Comments

@gmpassos
Copy link

gmpassos commented May 5, 2021

operations should be populated before schedule.

This line

operations[id] = op

should be placed before:

ioScheduler.schedule

The only thing that avoids an asynchronous bug is the delay of the operation execution,
what is not a correct pattern for synchronized data.

It's possible to have the operation executed before the operations[id] = op write.

synchronized(operations) { operations[id] = op }

@Blahartinger
Copy link

Blahartinger commented May 27, 2021

feel free to submit a pr with your proposed change along side appropriate unit tests

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants