Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import io.trino.connector.CatalogHandle;
import io.trino.connector.CatalogManagerModule;
import io.trino.connector.ConnectorManager;
import io.trino.connector.ConnectorServicesProvider;
import io.trino.cost.StatsCalculator;
import io.trino.dispatcher.DispatchManager;
import io.trino.eventlistener.EventListenerConfig;
Expand All @@ -58,6 +59,7 @@
import io.trino.memory.ClusterMemoryManager;
import io.trino.memory.LocalMemoryManager;
import io.trino.metadata.AllNodes;
import io.trino.metadata.CatalogManager;
import io.trino.metadata.FunctionBundle;
import io.trino.metadata.FunctionManager;
import io.trino.metadata.GlobalFunctionCatalog;
Expand Down Expand Up @@ -439,6 +441,10 @@ public CatalogHandle createCatalog(String catalogName, String connectorName, Map
{
CatalogHandle catalogHandle = connectorManager.createCatalog(catalogName, connectorName, properties);
updateConnectorIdAnnouncement(announcer, catalogHandle, nodeManager);

EventListenerManager eventListenerManager = injector.getInstance(EventListenerManager.class);
connectorManager.getConnectorServices(catalogHandle).getEventListeners().forEach(eventListenerManager::addEventListener);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need product tests to make sure that event listeners are truly registered?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Server correctly registered EventListeners, TestingTrinoServer did not, so it only affected (some) tests


return catalogHandle;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ MaterializedResultWithEvents runQueryAndWaitForEvents(@Language("SQL") String sq
}

QueryEvents queryEvents = eventsCollector.getQueryEvents(queryId);
queryEvents.waitForQueryCompletion(new Duration(30, SECONDS));
queryEvents.waitForQueryCompletion(new Duration(3, SECONDS));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is that possible that longer timeout fixed the issue? If there was no event listener registered then it should not work at all? Are you referring here to a different problem?

According #13321 it should be 30 seconds.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#13321 (comment) - no effect but considered an improvement.
FYI - #13370 - This PR is probably superseded @wendigo @kokosing


// Sleep some more so extraneous, unexpected events can be recorded too.
// This is not rock solid but improves effectiveness on detecting duplicate events.
Expand Down