Skip to content

Failure to wait for events to be sent when client closes ... GcpLineageTransportConfig #25

Description

@kolban-google

I have a Java application that is loosely as follows:

      GcpLineageTransportConfig gcpLineageTransportConfig = new GcpLineageTransportConfig();
      gcpLineageTransportConfig.setProjectId("**********");
      gcpLineageTransportConfig.setLocation("us-central1");

      OpenLineageClient client = OpenLineageClient.
        builder().
        transport(new GcpLineageTransport(gcpLineageTransportConfig)).
        build();

...

      client.emit(runStateUpdate);
      client.close();

What I find is that the application does not send the event. If I change the logic to:

      client.emit(runStateUpdate);
      System.out.println("Sleeping 5 seconds");
      Thread.sleep(1000*5);
      client.close();

the event is sent. What I believe is happening is that since the default is to transmit the event asynchronously (I.e. immediate return from client.emit(...)), I believe that client.close() is not waiting for queued event emission requests to be sent/flushed/processed. I believe this to be an error. The call to client.close() should block/wait for queued emitted events to be processed before returning.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions