Below is the gist of the comments made by Gamze Abaka in patch https://gerrit.opencord.org/c/voltha-openolt-adapter/+/30389. Creating this Jira for addressing this particular issue.
We are deleting gemports from the OLT when we call the RemoveSchedulerQueues method. Now, you are deleting a gem port from the cache and sending a gemPortDelete request to the ONU adapter before we delete the gem port from OLT. So, what if the gemport removal operation fails on the OLT? There will be a synchronization problem (ONU adapter will remove the gemport, we already freed the gemport-id but, the gemport will be on the OLT). After that, when we want to provision a new service to another ONU on the same pon port, it will always fail because of the gemport-id allocation. (OLT still uses the gemport for the previous ONU). How will we solve this problem?