mendix / m2ee-tools

m2ee, the Mendix runtime helper tools for GNU/Linux
Other
27 stars 40 forks source link

m2ee start - timeout setting?? #34

Closed hvisage closed 6 years ago

hvisage commented 6 years ago

Goodday,

so, busy with Ansible deploys, and I have errors with database connectivity, which causes the m2ee start to hang indefinitely.

The errors that scrolls through the log file:

2018-03-26 15:52:33.022 WARNING - ConnectionBus: Database connections: 0 active, 0 idle. 2018-03-26 15:52:33.022 ERROR - ConnectionBus: Opening JDBC connection to Some(192.168.200.22:5432) failed with SQLState: 08001 Error code: 0 Message: Connection to 192.168.200.22:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections., giving up...(4/4)

Yes, I also have a 2nd JDBC connection (where the Mendix App in this case fetches data to populate the "main"/modeller database).

What I'm in need of, is a sorta time-out for the start to fail with some errors if the Mendix doesn't start up in time. This might be to consider in the light of things like model (database structure) changes that does take a long(er) time to complete...

knorrie commented 6 years ago

The upcoming 7.2 release, (which I still have to finish up) now also exposes the timeout argument for the start_runtime api call (see develop branch). Thanks for pointing it out. I added a lot of them recently, to be able to actually set timeouts, but this one was still missing.

Also notice that the different levels of granularity of runtime api calls cause a different amount of feedback / progress report that we can get from the Mendix Runtime.

The whole start procedure is already divided into a number of steps, but each individual one just blocks until it's done or reports an error. Progress is logged to the application log file, but there's no way for the caller to find out if it's trying to connect the database, running the after-startup microflow etc.

knorrie commented 6 years ago

Included in v7.2-rc1