mirror of
https://github.com/opennetworkinglab/onos.git
synced 2025-12-25 11:11:47 +01:00
The submit() method of p4 WriteRequestImpl is returning an empty response if there are no update messages. However, one of the reasons for updates to be empty is the fact the catch block in appendToRequestMsg is reached due to some invalid usage of the p4runtime contract. In such situations, not only the user doesn't know why the request is failing (absence of logging in ONOS) but the responseBuilder which contains the failure is also not propagated. As a result, a future call to P4RuntimeWriteClient.WriteResponse.isSuccess() will return true (as if the request actually succeeded) and .all() will also not contain the failedResponse appended during the CodecException. Added a test to illustrate the issue. Change-Id: I0acfd3b34b3ed1db2d91f91fed08f9d00800dda4