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

Subbasin Timing Out on Staging #2811

Closed
rajadain opened this issue Apr 30, 2018 · 1 comment
Closed

Subbasin Timing Out on Staging #2811

rajadain opened this issue Apr 30, 2018 · 1 comment

Comments

@rajadain
Copy link
Member

Doesn't time out locally. Upon inspecting the Celery logs, I see the last entry in the log is:

[2018-04-30 16:45:19,173: INFO/MainProcess] Received task: apps.modeling.tasks.run_subbasin_gwlfe_chunks[9c3ab6c8-1da0-42b7-917e-f964c82cf1a7]

After which there is silence. Restarting Celery did not help. gwlf-e 0.6.3 is installed on the machine.

Find out what's wrong and make it work again.

@rajadain
Copy link
Member Author

rajadain commented May 4, 2018

Okay here’s the issue (as far as I can tell today):

  1. stream_lengths here:
    stream_lengths = sum_subbasin_stream_lengths(model_input)
    is a typed class that looks like this:
StreamLengthSummary(ag=21255.097623364967, urban=416954.90237663506)
  1. When it is used here:
    ag_pct_total_stream_length = gms['AgLength'] / total_stream_lengths['ag']
    , on my local, it appears as a dict:
{'urban': 416954.90237663506, 'ag': 21255.097623364967}
  1. When it is used in the same spot on staging, it appears as a list:
[21255.097623364967, 416954.90237663506]

which causes the named lookup to fail.

Now I’m investigating at what point this mistranslation happens, so we can fix it. Notably, the class is composed in the app VM, and parsed in the worker VM. Celery has had trouble deserializing classes in the past, but I don’t know why we’re seeing different behaviors in the two environments.

rajadain added a commit that referenced this issue May 6, 2018
For reasons currently not understood, the namedtuple
result of this method is interpreted as a dict by
Celery when run locally, but as a list when run on
staging.

By outputting a dict always, we ensure that it is
interpreted uniformly across platforms.

Refs #2811
rajadain added a commit that referenced this issue May 7, 2018
For reasons currently not understood, the namedtuple
result of this method is interpreted as a dict by
Celery when run locally, but as a list when run on
staging.

By outputting a dict always, we ensure that it is
interpreted uniformly across platforms.

Refs #2811
rajadain added a commit that referenced this issue May 7, 2018
Simplify Stream Totaling for Staging Compatibility

Connects #2811
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants