apache / apache/arrow-cookbook
[Java][Flight] Flight example appears to be flaky
- Dominant language
- C++
- Stars
- 108
- Forks
- 49
- Avg merge
- 2h 14m
- Merged PRs (30d)
- 1
Description
It looks like
```java
try {
flightServer.start();
System.out.println("S1: Server (Location): Listening on port " + flightServer.getPort());
} catch (IOException e) {
System.exit(1);
}
```
in one of the examples actually hit the `catch` and that `System.exit` causes jshell to print the `State engine terminated`
```
Expected:
S1: Server (Location): Listening on port 33333
C1: Client (Location): Connected to grpc+tcp://0.0.0.0:33333
C2: Client (Populate Data): Wrote 2 batches with 3 rows each
C3: Client (Get Metadata): FlightInfo{schema=Schema, descriptor=profiles, endpoints=[FlightEndpoint{locations=[Location{uri=grpc+tcp://0.0.0.0:33333}], ticket=org.apache.arrow.flight.Ticket@58871b0a}], bytes=-1, records=6}
C4: Client (Get Stream):
Client Received batch #1, Data:
name
Ronald
David
Francisco
Client Received batch #2, Data:
name
Manuel
Felipe
JJ
C5: Client (List Flights Info): FlightInfo{schema=Schema, descriptor=profiles, endpoints=[FlightEndpoint{locations=[Location{uri=grpc+tcp://0.0.0.0:33333}], ticket=org.apache.arrow.flight.Ticket@58871b0a}], bytes=-1, records=6}
C6: Client (Do Delete Action): Delete completed
C7: Client (List Flights Info): After delete - No records
C8: Server shut down successfully
Got:
State engine terminated.
**********************************************************************
```
IMO we should have `e.printStackTrace()` there for debugging
_Originally posted by @lidavidm in https://github.com/apache/arrow-cookbook/issues/193#issuecomment-1136305145_
Contributor guide
Research direction
Locate the Java Flight example containing the shown flightServer.start() try/catch and run it through jshell to reproduce the State engine terminated output. Inspect the startup failure path and compare the result with the expected server and client sequence; done means failures provide debugging information without obscuring the example's execution outcome.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- grpc, java
- Domain
- backend, testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100