[VOL-2848] : Protect concurrent access for PON resources

Flows currently were serialized on a per ONU basis. However flows
from different ONUs could add/remove concurrently. This meant
possible concurrent access of PON resources. In some tests it was
seen that two ONUs got same resource (like FlowID) and traffic
would fail.
This new change makes concurrent access to get/put/delete on shared PON resource pools
on KV store protected by locks. The adapter maintains certain data on
the KV store on a per ONU basis and this does not need any protection
as the key path are unique and provide inherant protection and moreover
any flow operation on a given ONU is serialized, this is not to worry.

Change-Id: I8a452a7ae84413741cbc2fa24ae42f4329748e32
3 files changed
tree: d5e5261cd985f8b9167aa1e449dde4f31d97228c
  1. .gitignore
  2. .gitreview
  3. .golangci.yml
  4. CODE_OF_CONDUCT.md
  5. Makefile
  6. README.md
  7. VERSION
  8. cmd/
  9. compose/
  10. docker/
  11. go.mod
  12. go.sum
  13. internal/
  14. pkg/
  15. vendor/
README.md

How to Build the Golang based OpenOLT Adapter

Working with Go Dependencies

This project uses Go Modules https://github.com/golang/go/wiki/Modules to manage dependencies. As a local best pratice this project also vendors the dependencies. If you need to update dependencies please follow the Go Modules best practices and also perform the following steps before committing a patch:

go mod tidy
go mod verify
go mod vendor

Building with a Local Copy of voltha-protos or voltha-lib-go

If you want to build/test using a local copy or voltha-protos or voltha-lib-go this can be accomplished by using the environment variables LOCAL_PROTOS and LOCAL_LIB_GO. These environment variables should be set to the filesystem path where the local source is located, e.g.

LOCAL\_PROTOS=$HOME/src/voltha-protos
LOCAL\_LIB\_GO=$HOME/src/voltha-lib-go

When these environment variables are set the vendored versions of these packages will be removed from the vendor directory and replaced by coping the files from the specified locations to the vendor directory. NOTE: this means that the files in the vendor directory are no longer what is in the git repository and it will take manual git intervention to put the original files back.