1. A computer program product comprising a non-transitory computer readable storage medium having a computer readable program stored therein, wherein the computer readable program, when executed on a data processing system, causes the data processing system to: detect, by kernelspace logic resident in a kernelspace of the data processing system, an error event having occurred; perform, by the kernelspace logic, a write operation to write an error state value to a userspace shared memory state data structure indicating a Remote Direct Memory Access (RDMA) resource to be in an error state; detect, by userspace logic of the data processing system, the RDMA resource being in an error state by reading the error state value from the userspace shared memory state data structure in response to a userspace application attempting to perform a RDMA operation using the RDMA resource; and initiate, by the userspace logic, an operation to tear down the RDMA resource in response to detecting the RDMA resource being in the error state.