Concurrent AVP encoding issue - AvpDataException: Not enough data in buffer! (fixes #1) #2
We have found 2 concurrency issues with AVP encoding/decoding when doing load tests.
And also a BufferOverflow in the end:
Problem - encoded/decoded Diameter packets get corrupted (missing child AVPs).
Reason - This is due to the fact that the function getGrouped that converts AvpImpl.java rawData to groupedData is called
2.We also obtained a
With this pull I propose a possible fix for this issue. Also to encapsulate more the existing data in AvpImpl.java, i.e. make rawData/groupedData not accessible from outside. ALSO to forbid to swap between rawData/groupedData in runtime, i.e. to not change created AVP.
referenced this pull request
Aug 20, 2015
Hi @tomazas, would you have the time to revisit this PR so it can be merged ? It has a few conflicts now, and some of the changes are already covered in other ways (eg, addPeerName duplicate check is already done with
Ideally a PR should solve a specific problem, this way it's easier to review and merge each fix. Feel free to break into smaller PRs if you feel like.
This PR includes several changes:
Will prepare commits with the valid fixes, in case the first issue is observed again we can revisit and try to fix it a better way.