Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consistently check Status.getStackDump() is non-empty in exception message construction #117

Open
joeshannon opened this issue Sep 6, 2021 · 0 comments

Comments

@joeshannon
Copy link
Contributor

The Status (org.epics.pvdata.pv.Status) interface defines getStackDump which returns a string.

This is used in several places for logging purposes or to construct other exceptions.

When working with RPCClientImpl we are seeing that the RPCRequestException contains a superfluous ", cause:\n". This is because the string from getStackDump() is non-null but an empty string but only non-null is considered in RPCClientImpl. In other places the string is already checked to be empty. Here is a summary of the callers:

  • org.epics.pvaccess.server.impl.remote.tcp.BlockingServerTCPTransport.authenticationCompleted(Status)
  • org.epics.pvaccess.server.impl.remote.tcp.NonBlockingServerTCPTransport.authenticationCompleted(Status)
  • org.epics.pvaccess.server.impl.remote.rpc.ServerRPCService.OpChannels.execute()
  • org.epics.pvaccess.client.impl.remote.handlers.CreateChannelHandler.handleResponse(InetSocketAddress, Transport, byte, byte, int, ByteBuffer)
  • org.epics.pvaccess.client.rpc.RPCClientImpl.request(PVStructure, double)
  • org.epics.pvaccess.impl.remote.tcp.BlockingTCPTransport.verified(Status)
  • org.epics.pvaccess.impl.remote.tcp.NonBlockingTCPTransport.verified(Status)

All apart from RPCClientImpl and ServerRPCService already check this.

joeshannon added a commit to joeshannon/epicsCoreJava that referenced this issue Sep 6, 2021
This check is already used in methods such as
BlockingServerTCPTransport#authenticationCompleted.
joeshannon added a commit to joeshannon/epicsCoreJava that referenced this issue Sep 6, 2021
This check is already used in methods such as
BlockingServerTCPTransport#authenticationCompleted.
shroffk added a commit that referenced this issue Sep 8, 2021
#117 Check Status.getStackDump() is non-empty before use
DiamondLightSource-Gerrit-server pushed a commit to openGDA/gda-core that referenced this issue Oct 5, 2022
This is an issue in the epicsCoreJava repository:
epics-base/epicsCoreJava#117

Until this is fixed, and we can update to a version which includes it,
manually remove the trailing string.

Change-Id: I8a60e5bb59718be45bde866363e42574b3efc7df
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant