Generator-jhipster: can not debug jhipster import-jdl

Created on 11 May 2019  路  8Comments  路  Source: jhipster/generator-jhipster

Overview of the issue


I can not debug jhipster import-jdl anymore since 6.0.0

Motivation for or Use Case


I'm trying to debug a blueprint

Reproduce the error

/usr/bin/env node --inspect-brk /usr/bin/jhipster import-jdl jhipster.jh

Related issues
Suggest a Fix

increment the debug port foreach subprocess, I think this caused because import-jdl starts another subprocess per application now.

JHipster Version(s)

6.0.0

this is a regression

JHipster configuration

jdl:

application {
  config {
    baseName primengtest
    applicationType monolith
    prodDatabaseType mysql
    buildTool gradle
  }
  entities *
}

entity Task {
    name String required
    cost Integer required
    billable Boolean required
    type TaskType required
    createdAt ZonedDateTime required
    deadline LocalDate required
    picture ImageBlob
    txtBlob TextBlob required
    aBlob Blob
}

enum TaskType {
    NEW, IN_PROGRESS, PENDING, TERMINATED
}

Entity configuration(s) entityName.json files generated in the .jhipster directory

Browsers and Operating System


Fedora

  • [X] Checking this box is mandatory (this is just to show you read everything)
area JDL

All 8 comments

If you know how it can be improved, PR are welcome ! :)

Well for me, we should have a mode that doesn't do do any process forks as it becomes impossible to control generation using the API. Also when generating apps in a serverless environment I had problems as Google Cloud Run would kill my app and not wait for the subprocesses.

My workaround for now is to use --interactive. @yelhouti can you try it.

my work-around for now is: --inspect-brk=0 this picks a random port forach subprocess that I read on the terminal that I use to debug, but it's a PITA since it changes every time.
another solution would be to increment it foreach subprocess, but if a subprocess have it's own forks they will be collisions again...
Another approach would be to have extra args in th JDL file, that can be used for other stuff inclusing have a dedicated debug port

Here a similar issue https://github.com/jhipster/generator-jhipster/issues/9570 -> it's not exactly the same

The related code is here: https://github.com/jhipster/generator-jhipster/blob/master/cli/import-jdl.js#L195-L221

Don't hesitate to submit a PR to improve it plz.

For me the best way to resolve this is still to create a mode to have only one process.

The issue here is using Yeoman, which doesn't quite let you do that in parallel... Using node, you can always launch another node process, but a Yeoman generation has steps that prevent you from generating things how you want (in parallel). So yeah, if we decide do to things sequentially, then it's over: we don't have this issue anymore.
Another issue is dealing with app directories... again, yeoman isn't great at dealing with those. That's why we may need separate processes (first issue).
I think this issue is like 1-year old...

So the reason I decided to do things in parallel is to cut down the time it takes, when you have multiple apps it takes too long to generate everything if you run them in a single process. So I would indeed suggest using --interactive when debugging. @MathieuAA the import-jdl subgen doesn't use yeoman, it's directly on the CLI, only when existing subgens are invoked yeoman comes into play, but ya I agree if we move out of yeoman(which I proposed last year) we could do things in a much efficient manner

I'm closing this as I don't think we can do much here with current stack

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ahmedeldeeb25 picture ahmedeldeeb25  路  3Comments

RizziCR picture RizziCR  路  3Comments

trajakovic picture trajakovic  路  4Comments

kaidohallik picture kaidohallik  路  3Comments

lsadehaan picture lsadehaan  路  3Comments