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

[BUG] After restarting the typhonql-server it never gets initialized if the polystore isn't also restarted #68

Closed
DavyLandman opened this issue Mar 11, 2020 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@DavyLandman
Copy link
Contributor

DavyLandman commented Mar 11, 2020

Describe the bug

When the typhonql-server restarts, it needs to get the ML & DL model from the polystore-api. Currently it waits for a call form the polystore-api to set this up, but the API doesn't know when the typhonql-server is restarted, so it never resends it.

Expected behavior

When the typhonql-server restarts (like for example after a container update), it should be ready to handle incoming requests.

REST API

typhonql-server             | 06:07:46.708 [qtp1092572064-13] ERROR engineering.swat.typhonql.server.QLRestServer - Failed to handle response
typhonql-server             | java.io.IOException: Backend is not initialized yet
typhonql-server             |   at engineering.swat.typhonql.server.QueryEngine.getBackend(QueryEngine.java:23) ~[classes/:?]
typhonql-server             |   at engineering.swat.typhonql.server.QueryEngine.resetDatabase(QueryEngine.java:47) ~[classes/:?]

Work-around
Follow a docker-compose up -d with a docker-compose restart typhon-polystore-api

Possible solution
Will have to discuss with @OrfenCLMS about which strategy is preferred:

  1. Change the REST interface of the QL server that it always receives the ML & DL information on every call.
  2. On startup of the server, we send a message to the polystore-api to register a fresh typhonql-server (not sure if we can always know where the polystore-api server is running, especially in relation to k8s, see: How should we do service discovery in a container runtime agnostic way? typhondl#24)
  3. Implement a ping/healthcheck feature from the polystore-api, so that it knows when a service has restarted.
@DavyLandman DavyLandman added the bug Something isn't working label Mar 11, 2020
@DavyLandman DavyLandman self-assigned this Mar 11, 2020
@OrfenCLMS
Copy link
Contributor

This will need to have a more in depth discussion, but regarding potential solution 1, this would make all requests a bit bloated without needing the full ML & DL models apart from edge cases (QL server does not restart that often i assume). Additionally, the ML & DL models can potentially be really big (probably not, but still). Still, this could be used as a temporary workaround until/unless we think of a better solution.

@DavyLandman
Copy link
Contributor Author

I agree, option 1 is a work around, but it does keep it more stateless, and avoids cyclic dependencies between the API & QLServer.

@DavyLandman
Copy link
Contributor Author

happy to say this problem has been solved (h/t @OrfenCLMS). We decided to always send along the ML & DL model over every call to the rest server. This allowed the whole QLServer to become stateless, which also helps for the plans for k8s (see typhon-project/typhon-polystore-api#14)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants