mbta / alerts_concierge Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Startup time for the app is 60+ seconds for me.
I suspect there are network calls being made during, and blocking during the supervisor tree startup.
More to follow.
This only happened once, but it's worth investigating:
1) test Worker passes jobs from sending queue to notification (AlertProcessor.NotificationWorkerTest)
test/alert_processor/dissemination/notification_worker_test.exs:60
No message matching {:trace, ^pid, :receive, {:sent_notification_email, _}} after 100ms.
The following variables were pinned:
pid = #PID<0.2492.0>
Process mailbox:
{:trace, #PID<0.2492.0>, :receive, :notification}
{:trace, #PID<0.2492.0>, :receive, {#Reference<0.2078369325.352845825.37173>, :error}}
{:trace, #PID<0.2492.0>, :receive, :notification}
{:trace, #PID<0.2492.0>, :receive, {#Reference<0.2078369325.352845825.49818>, :error}}
code: assert_receive {:trace, ^pid, :receive, {:sent_notification_email, _}}
stacktrace:
test/alert_processor/dissemination/notification_worker_test.exs:71: (test)
The module AlertProcessor.HoldingQueue
is found in apps/alert_processor/lib/dissemination/holding_queue.ex
should be named AlertProcessor.Dissemination.HoldingQueue
or be moved to apps/alert_processor/lib
.
This applies to many modules.
Wallaby fails after ~30 secs of blocking during tests.
** (Mix) Could not start application wallaby: Wallaby.start(:normal, []) returned an error: shutdown: failed to start child: Wallaby.Phantom
** (EXIT) shutdown: failed to start child: Wallaby.ServerPool
** (EXIT) an exception was raised:
** (MatchError) no match of right hand side value: {:error, {:crashed, 1}}
(poolboy) src/poolboy.erl:275: :poolboy.new_worker/1
(poolboy) src/poolboy.erl:296: :poolboy.prepopulate/3
(poolboy) src/poolboy.erl:145: :poolboy.init/3
(stdlib) gen_server.erl:365: :gen_server.init_it/2
(stdlib) gen_server.erl:333: :gen_server.init_it/6
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
2018-03-07 13:56:30.071 [error] GenServer #PID<0.1077.0> terminating
** (MatchError) no match of right hand side value: {:error, {:crashed, 1}}
(poolboy) src/poolboy.erl:275: :poolboy.new_worker/1
(poolboy) src/poolboy.erl:296: :poolboy.prepopulate/3
(poolboy) src/poolboy.erl:145: :poolboy.init/3
(stdlib) gen_server.erl:365: :gen_server.init_it/2
(stdlib) gen_server.erl:333: :gen_server.init_it/6
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: {:EXIT, #PID<0.1076.0>, {{:badmatch, {:error, {:crashed, 1}}}, [{:poolboy, :new_worker, 1, [file: 'src/poolboy.erl', line: 275]}, {:poolboy, :prepopulate, 3, [file: 'src/poolboy.erl', line: 296]}, {:poolboy, :init, 3, [file: 'src/poolboy.erl', line: 145]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 365]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 333]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}
AlertProcessor.AlertsClient.get_alerts/0 is spamming crash errors because of an invalid JSON response.
The error:
[error] GenServer AlertProcessor.AlertWorker terminating
** (Poison.SyntaxError) Unexpected token: <
(poison) lib/poison/parser.ex:56: Poison.Parser.parse!/2
(poison) lib/poison.ex:83: Poison.decode!/2
(httpoison) lib/httpoison/base.ex:471: HTTPoison.Base.response/6
(alert_processor) lib/api/alerts_client.ex:13: AlertProcessor.AlertsClient.get_alerts/0
(alert_processor) lib/alert_parsing/alert_parser.ex:20: AlertProcessor.AlertParser.process_alerts/0
(alert_processor) lib/alert_parsing/alert_worker.ex:28: AlertProcessor.AlertWorker.handle_info/2
(stdlib) gen_server.erl:616: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:686: :gen_server.handle_msg/6
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: :work
Running mix ecto.setup
for the first time we get the following error:
[error] Task #PID<0.9909.0> started from AlertProcessor.ServiceInfoCache terminating
** (MatchError) no match of right hand side value: {:error, "rate_limited"}
(alert_processor) lib/service_info/service_info_cache.ex:409: AlertProcessor.ServiceInfoCache.do_headsigns/2
(elixir) lib/task/supervised.ex:85: Task.Supervised.do_apply/2
(elixir) lib/task/supervised.ex:36: Task.Supervised.reply/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Function: &AlertProcessor.ServiceInfoCache.do_headsigns/2
Args: ["5", 0]
[info] Application alert_processor exited: AlertProcessor.start(:normal, []) returned an error: shutdown: failed to start child: AlertProcessor.ServiceInfoCache
** (EXIT) an exception was raised:
** (MatchError) no match of right hand side value: {:error, "rate_limited"}
(alert_processor) lib/service_info/service_info_cache.ex:409: AlertProcessor.ServiceInfoCache.do_headsigns/2
(elixir) lib/task/supervised.ex:85: Task.Supervised.do_apply/2
(elixir) lib/task/supervised.ex:36: Task.Supervised.reply/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
[info] Application paper_trail exited: :stopped
[info] Application eflame exited: :stopped
[info] Application cowboy exited: :stopped
[info] Application cowlib exited: :stopped
[info] Application ranch exited: :stopped
[info] Application excoveralls exited: :stopped
[info] Application exjsx exited: :stopped
[info] Application dialyxir exited: :stopped
[info] Application dialyzer exited: :stopped
[info] Application wx exited: :stopped
[info] Application hipe exited: :stopped
[info] Application edeliver exited: :stopped
[info] Application scrivener_ecto exited: :stopped
[info] Application scrivener exited: :stopped
[info] Application runtime_tools exited: :stopped
[info] Application httpoison exited: :stopped
[info] Application ex_rated exited: :stopped
[info] Application ex_aws exited: :stopped
[info] Application sweet_xml exited: :stopped
[info] Application xmerl exited: :stopped
[info] Application con_cache exited: :stopped
[info] Application comeonin exited: :stopped
[info] Application calendar exited: :stopped
[info] Application tzdata exited: :stopped
[info] Application hackney exited: :stopped
[info] Application metrics exited: :stopped
[info] Application ssl_verify_fun exited: :stopped
[info] Application certifi exited: :stopped
[info] Application mimerl exited: :stopped
[info] Application idna exited: :stopped
=INFO REPORT==== 7-Mar-2018::13:15:43 ===
application: logger
exited: stopped
type: temporary
=INFO REPORT==== 7-Mar-2018::13:15:43 ===
application: jsx
exited: stopped
type: temporary
=INFO REPORT==== 7-Mar-2018::13:15:43 ===
application: ex2ms
exited: stopped
type: temporary
=INFO REPORT==== 7-Mar-2018::13:15:43 ===
application: elixir_make
exited: stopped
type: temporary
** (Mix) Could not start application alert_processor: AlertProcessor.start(:normal, []) returned an error: shutdown: failed to start child: AlertProcessor.ServiceInfoCache
** (EXIT) an exception was raised:
** (MatchError) no match of right hand side value: {:error, "rate_limited"}
(alert_processor) lib/service_info/service_info_cache.ex:409: AlertProcessor.ServiceInfoCache.do_headsigns/2
(elixir) lib/task/supervised.ex:85: Task.Supervised.do_apply/2
(elixir) lib/task/supervised.ex:36: Task.Supervised.reply/5
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
In the umbrella app's mix.exs
there is an aliases that looks like:
defp aliases do
["ecto.setup": ["ecto.create", "ecto.migrate", "run apps/alert_processor/priv/repo/seeds.exs"],
"ecto.reset": ["ecto.drop", "ecto.setup"],
"test.all": ["ecto.create --quiet", "ecto.migrate", "mocha_test", "coveralls.json", "test"]]
end
Removing the step for running seeds "run apps/alert_processor/priv/repo/seeds.exs"
allows the migration command to succeed. However, this is a hack that simply keeps the runtime from starting the apps' supervision trees.
We should fix the issue in AlertProcessor.ServiceInfoCache
.
1) test creating a bike storage subscription (ConciergeSite.BikeStorageSubscriptionTest)
test/feature/bike_storage_subscription_test.exs:11
** (Wallaby.QueryError) Expected to find 1, visible text input or textarea 'station' but 0, visible text inputs or textareas were found.
code: |> fill_in(text_field("station"), with: "Alewife")
stacktrace:
(wallaby) lib/wallaby/browser.ex:471: Wallaby.Browser.find/2
(wallaby) lib/wallaby/browser.ex:452: Wallaby.Browser.find/3
test/feature/bike_storage_subscription_test.exs:17: (test)
2) test creating a parking subscription (ConciergeSite.ParkingSubscriptionTest)
test/feature/parking_subscription_test.exs:11
** (Wallaby.QueryError) Expected to find 1, visible text input or textarea 'station' but 0, visible text inputs or textareas were found.
code: |> fill_in(text_field("station"), with: "South Station")
stacktrace:
(wallaby) lib/wallaby/browser.ex:471: Wallaby.Browser.find/2
(wallaby) lib/wallaby/browser.ex:452: Wallaby.Browser.find/3
test/feature/parking_subscription_test.exs:17: (test)
3) test editing an accessibility subscription (ConciergeSite.EditSubscriptionTest)
test/feature/edit_subscription_test.exs:11
** (Wallaby.QueryError) The text 'station' matched a label but the label's 'for' attribute
doesn't match the id of any element.
Make sure that id on your element is `id="station"`.
code: |> create_subscription
stacktrace:
(wallaby) lib/wallaby/browser.ex:473: Wallaby.Browser.find/2
(wallaby) lib/wallaby/browser.ex:452: Wallaby.Browser.find/3
test/feature/edit_subscription_test.exs:45: ConciergeSite.EditSubscriptionTest.create_subscription/2
test/feature/edit_subscription_test.exs:16: (test)
4) test creating an accessibility subscription (ConciergeSite.AccessibilitySubscriptionTest)
test/feature/accessibility_subscription_test.exs:11
** (Wallaby.QueryError) The text 'station' matched a label but the label's 'for' attribute
doesn't match the id of any element.
Make sure that id on your element is `id="station"`.
code: |> fill_in(text_field("station"), with: "Central")
stacktrace:
(wallaby) lib/wallaby/browser.ex:473: Wallaby.Browser.find/2
(wallaby) lib/wallaby/browser.ex:452: Wallaby.Browser.find/3
test/feature/accessibility_subscription_test.exs:18: (test)
....2018-03-12 13:29:22.537 [error] GenServer AlertProcessor.AlertWorker terminating
** (FunctionClauseError) no function clause matching in AlertProcessor.AlertWorker.handle_info/2
(alert_processor) lib/alert_parsing/alert_worker.ex:27: AlertProcessor.AlertWorker.handle_info(:processed_alerts, nil)
(stdlib) gen_server.erl:616: :gen_server.try_dispatch/4
(stdlib) gen_server.erl:686: :gen_server.handle_msg/6
(stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
Last message: :processed_alerts
.
5) test deleting a subscription (ConciergeSite.EditSubscriptionTest)
test/feature/edit_subscription_test.exs:25
** (Wallaby.QueryError) The text 'station' matched a label but the label's 'for' attribute
doesn't match the id of any element.
Make sure that id on your element is `id="station"`.
code: |> create_subscription("Weekdays")
stacktrace:
(wallaby) lib/wallaby/browser.ex:473: Wallaby.Browser.find/2
(wallaby) lib/wallaby/browser.ex:452: Wallaby.Browser.find/3
test/feature/edit_subscription_test.exs:45: ConciergeSite.EditSubscriptionTest.create_subscription/2
test/feature/edit_subscription_test.exs:30: (test)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.