Skip to content

Trollmoves Server should crash if "origin" directory doesn't exist #118

@pnuu

Description

@pnuu

Describe the bug
Trollmoves Server (move_it_server.py) should crash if the followed data directory (origin in config) doesn't exist. At the moment only ERROR pyinotify] add_watch: cannot watch /path/to/dir WD=-1, Errno=No such file or directory (ENOENT) is logged and the process hangs. If the directory is created without a restart, the process doesn't notice it.

To Reproduce

Create a test.ini file:

[test]
origin = /path/to/nonexistent/directory
topic = /foo
request_port = 9201

Start Trollmoves Server:

move_it_server.py -v test.ini

Expected behavior
The process should crash so that the problem would be evident ASAP.

Actual results

[2022-05-13 10:28:33,036 INFO     move_it_server] Starting up.
[2022-05-13 10:28:33,040 DEBUG    trollmoves.server] New config file detected: test.ini
[2022-05-13 10:28:33,040 WARNING  trollmoves.server] Station is not defined in config file
[2022-05-13 10:28:33,040 DEBUG    trollmoves.server] Station is 'unknown'
[2022-05-13 10:28:33,040 DEBUG    trollmoves.server] Created request manager on port 9201
[2022-05-13 10:28:33,040 INFO     trollmoves.server] Using inotify notifier
[2022-05-13 10:28:33,043 ERROR    pyinotify] add_watch: cannot watch /path/to/nonexistent WD=-1, Errno=No such file or directory (ENOENT)
[2022-05-13 10:28:33,043 ERROR    pyinotify] add_watch: cannot watch /path/to/nonexistent WD=-1, Errno=No such file or directory (ENOENT)
[2022-05-13 10:28:33,044 DEBUG    trollmoves.server] Added test
[2022-05-13 10:28:33,044 DEBUG    trollmoves.server] Reloaded config from test.ini
[2022-05-13 10:28:36,044 DEBUG    trollmoves.server] done reloading config
[2022-05-13 10:28:37,045 DEBUG    posttroll.publisher] Publish heartbeat (min_interval is 30.0 sec)

Environment Info:

  • OS: Linux
  • Trollmoves Version: any

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions