It is now time for oral questions, and I recognize the member for Tomiskaming Cochran. My question is to the Deputy Premier. For the last two weeks, the Premier has ignored the growing concern about the clear conflict of interest he showed in personally appointing a family friend as OPP Commissioner. Now even Ron Taverner himself has admitted that he can't assume command under the cloud of suspicion created by the Premier. Government side, come to order. Will the Deputy Premier continue to defend the indefensible, or will she admit that we need an investigation by the Ombudsman and by members of this assembly before this appointment can proceed? The Deputy Premier. The Minister of Community Safety and Correctional Services. The Minister of Community Safety and Correctional Services. Our government, the Independent Hiring Committee, our public service has 100% support and trust and faith in Superintendent Taverner. Out of respect for the people who serve our province on the front line, our police officers, Ron Taverner asked me if he could step aside while the investigation was taking place. I accepted that recommendation. I think it was a very wise and frankly respectful thing for him to do because he understands the process and he wants the process to have its purpose. We are doing that. We understand that the Independent Officer of the Legislative Assembly and the Integrity Commissioner will do his investigation on his work. At that point, when the investigation is complete, I will be right at the front of the line to congratulate Ron Taverner and welcome him as the President. Once again to the Acting Premier. The Deputy Commissioner of the OPP is just one of the many people who has raised serious concerns. In a letter to the Ombudsman, Deputy Commissioner Brad Blair said, and I quote, the independence and confidence of the command of the OPP was at risk without a review from the Ombudsman. Does the Deputy Premier agree with the Deputy and now former Acting Commissioner that we need this independent public review? Well, to be clear, the independent review is happening currently through the Integrity Commissioner. But what I am hearing since Friday is people from across Ontario talking about what are we going to do to ensure that we keep the heat on and the power on in the problems we're dealing with. This is and our government's focus is. Final supplementary. I think they've been watching the PC. Once again to the Deputy Premier. Deputy Commissioner Blair doesn't stand alone. Former RCMP Commissioner Bob Paulson is echoed calls for an independent public review saying, quotation, that sense of integrity of the institution has to be preserved and quote. The former OPP Commissioner Chris Lewis was more blunt. Quote, it's simply not right and not the best for the organization end of quote. The Premier responded by calling the integrity of this decorated OPP veteran into question. The Deputy Premier must know. She must know this isn't right. Will she stand with these decorated officers and back their calls for independent review? Or will she stand with the Premier who attacks them? Minister. You know, Speaker, in the 10 plus years that I've served in this parliament, I have never, ever heard someone suggest that the independent officer of the legislative assembly, the integrity commissioner, had anything but respect for this chamber. They report to this chamber, not to individual members. So to suggest that they are not in any way independent and they can't do the investigation, I think is shameful. I want to see the NDP say, we respect the independent officer. We respect the integrity commissioner and we will allow him the time that he and his office need to do the investigation and issue the report. Thank you. Next question, the member for Brampton Centre. Thank you. Good morning, Mr. Speaker. My question is to the Deputy Premier. Under the members integrity act, the integrity commissioner has the right to launch a public inquiry into any matter that has been referred to him. This matter is before him now. Will the acting Premier join us in supporting a public inquiry into the event the commissioner calls for one? The Deputy Premier. The Minister of Community Safety and Correctional Services. The Minister of Community Safety and Correctional Services. Speaker, I'm not sure what part of the independent integrity commissioner investigation has already started. He has accepted. Don't they understand? Opposition has come to order. But to be clear, the investigation has begun. The integrity commissioner is in charge of that investigation. I look forward to the report because I know he will find that there was nothing wrong with the process, and Ron Tavner is an excellent choice for OPP commissioner. I am surprised, frankly, that you are not asking questions about what's going to happen at the Brampton Civic Hospital when we don't have any. Supplementary. Thank you. Through you, Mr. Speaker, to the Minister, I would love to ask questions about Brampton Civic, but I know I'm not going to get any answers anyway, so I'm not going to waste my time on that. Would the Deputy Premier agree that, given the serious nature of the questions of the appointment, questions that the Premier, frankly, won't even answer is a public inquiry necessary? And it's public. It's not just the integrity commissioner. It's a public inquiry that we're asking for. Minister? I'm trying to connect the dots, Speaker, respectfully. So an independent officer of the assembly is independent and okay. Until they don't give you what you want, they are independent. Let them do their work. Let them do the investigation. Let the report come forward, and then we can talk about how excellent a candidate Ron Tavner is. Back to the Deputy Premier. People want and deserve answers. The Premier claims that a close personal friend was granted this position, and he has had no role in the decision-making process. Government side, come to order. That friend was not even qualified to apply for the job that was originally posted. Minister of Children, Community and Social Services, come to order. This decision is going to be upheld, and people are going to feel confident in the process. Will you support a full public inquiry by the integrity commissioner? The question is very simple. Minister? Minister? So allow me to repeat myself. Again, the independent officer of the legislative assembly, the integrity commissioner, is currently investing the process for hiring Commissioner Ron Tavner. I do not understand why the OPP, why the opposition have suddenly decided that the independent officer Is not up to the job I think it's really unfortunate that you suddenly decide an independent officer of the assembly the legislative assembly Reporting to the entire chamber is not good enough for this process. It's shame Thank you very much bigger my question is to the deputy premier speaker the deputy commissioner of the OPP has raised serious concerns about a request from Dean French the premier's chief of staff to soul source a Camper van Exclusively for the premier's use and keep the cost off the books and hidden from taxpayers To the deputy premier is has Dean Specks for this premier's Hot Wheels magic mystery tour bus with cabinet Minister of Community Safety and Correctional Service Community Safety and Correctional Service That question is so rude and dismissive. I'm actually amazed that you were willing to ask it Why why when we are called the position side before Christmas? Why are we not asking questions about why we're here the importance of why we're here? The value of what we are trying to do to the people of Ontario. This is about Heating people's homes. This is about keeping seniors Safe, this is frankly about making sure that the province of Ontario can continue to operate After Friday, when is the NDP going to step up and be part of the solution instead of constantly trying to find some other Appreciate the enthusiasm of the members It's all part of the season But I have to be able to hear the member who has the floor Start the clock member for Essex supplementary speaker We wish the premier and his government would learn a little something about collective bargaining with the power workers Free and fair collective bargaining A mystery tour bus for him and his buddies at taxpayers expense The Government side has to come to order I Will ask you individually to come to order and then I will have to move to warnings if need be We move to the next step Apologize to the member for Essex start the clock Thank You speaker the deputy premier was the choice of most PC delegates in the leadership race So it has to be pretty tough for her to watch What's become of her party the party that was once the party of Bill Davis is now treating the Ontario Provincial Police like a custom body shop Asking decorated King's bond to cover hide the cost from taxpayers. Will the deputy premier Looking to this abuse of power By the pre couldn't hear the member who had the floor because of the volume stop the clock I Couldn't hear the member for the volume of the government side. So if I miss something That's why I again say to the member for Essex you've got the floor and you can put your question Thank You speaker the question is to the deputy premier will she admit that the use of The OPP to cover the cost of the premier's custom travel van is an abuse of power and wrong to be hiding from taxpayers of Ontario I Will take no lessons from that member or the NDP party on why it is important for the province of Ontario to have heat and Hydro as of Friday now There is no truth to the allegations that have been levied and I look forward to a report coming from the Integrity commissioner to reinforce why Ron taverner is an excellent choice to serve as the OPP commissioner Next question the member for King Vaughan Mr. Speaker I find it with great regret that the NDP has yet to ask a singular question about keeping the power on in the province of Ontario Mr. Speaker the people across this province need and deserve a reliable power source This is at risk Speaker after NDP twice twice voted against expiring the passage of the bill this question Yeah, who's the question to this sort of energy the Speaker after twice voting against the passage of this bill it is abundantly clear mr. Speaker the VNDP is the party of Special interest whereas this government and this premier and this caucus and this minister is always fighting for the public interest For our small businesses for our workers for our young families for our seniors and for the people of the province We know a strike would devastate our economy Speaker can the minister online why how how we will put this forward and ensure on turns to keep the light on this Christmas Mr. Speaker and I appreciate the members Question let's start this part of the debate out by understanding that on June 7th of 2018 had the NDP won Thousands of nuclear workers in Pickering would have been cut loose Electricity system source Supply Absolute chaos so that's the starting point for these people mr. Speaker, but let me reference a few points It's a discussion points for Hamilton East or the creek or some time when the threat of hydro being cut off was very real The leader of the opposition said let me put my glasses on and read me some quotes here now 2017 in reference to legislation that would end or end winter disconnection get it through the house quickly Absolutely, I'm 100% favor for that. Why is she so disconnected now mr. Speaker? Back to the minister of energy speaker We know this dispute will devastate on trails industry a special or small businesses were over eight and ten jobs Depend on mr. Speaker We've been warned that this could result in rolling blackouts and brown nuts decimating the productivity and quality control factories across the province It will hurt our workers the most our government will not stand idle While employers are forced to close and paychecks on their workers are at risk Our government believes that everyone deserves safety and stability this holiday season Can the minister please update this house on how this dispute could impact business and industry in manufacturing minister Thank You mr. Speaker let me read me a few more quotes while I got my glasses on here 2017 the official leader of the opposition said in response to the threat of hydro being disconnected Why political credit is more important than stopping people from having their hydro cut off? Another quote when people get cut off in the winter. It has serious consequences here in a province like Ontario. I Agree mr. Speaker position come to order I I completely I completely Couldn't agree more mr. Speaker and Mr. Speaker I couldn't agree more with you It's cold outside the other night. It was minus 17 below in canora today right now right now It's minus 12 in Timmins mr. Speaker. This government has a responsibility to ensure that families Turn their heat on those will come to order the member for Timmins will come door Member for York's Center will come door start the clock next question the member for Davenport mr. Speaker My question is to the deputy premier Friday night school boards and education organizations across Ontario were struck by an avalanche of memos Outlining 25 million dollars in cuts these cuts are a slap in the face to those Ontarians who have participated in this government's so-called Consultations, which of course did not even conclude until 24 hours after these cuts were announced or released rather in the dead of night And they are causing utter chaos in our school boards and in our schools mr. Speaker Overwhelmingly the programs affected are designed to help at-risk youth the government has yet to share what actual Research they have conducted that shows that children getting physical activity or children getting programming to help them Succeed if they're at risk or providing leadership opportunities for for children are programs that need to be cut What research does this government conduct or rely on to determine that these programs were worth cutting from our schools? Mr. Education Christmas and I appreciate the opportunity to stand up and and talk about what's really important You know while we should be here working diligently on Expediating members of Waterloo come to order and lights on as we head into the holiday season instead We see opposition party for Winter West come to order But I'd be pleased to answer the member opposites question because you know I would think that or I would have hoped that they could have connected the dots a little bit better Because the consultation that we just wrapped up this past weekend where tens of thousands of people Responded and I can't wait to start diving into that data. It's so rich speaker that consultation was based For the next school year 1920 you would have thought the members opposite could have connected those dots, you know That's what our consultation was based on and first and foremost. We've received great information Sorry Supplementary Speaker back to the deputy premier This government is let's be clear taking an axe to programs that are designed to help some of our most vulnerable students They call this a responsible act minister mr. Speaker I don't understand what part of this is responsible the minister wants us to believe that they are listening to Ontarians But we have students saying this is the wrong direction. We have educators saying this is the wrong direction We have parents worrying that their kids won't have the supports. They need to succeed this school year We have experts saying this is deeply irresponsible in what universe Who did the minister consult tell us who told them that tutors in classrooms? We're not worth investing in indigenous kids We're not worth investing in the government sex ed consultation has been a total sham and kids While they make up excuses to carry out changes will the government reverse these irresponsible decisions Minister thank you very much mr. Speaker and again to correct the members opposite that couldn't connect the dots its school year 2019 2020 and you know what? I'm pleased to say that we're moving forward. We moved a four forward with approvals of $400 million this year for the school year 2018-2019 and at a glance that talks about a new investment of over 20 million dollars for mental health workers over $20 million in French language education over 60 million dollars initiatives and We absolutely are supporting our parents in terms of Supports for our young children in terms of bullying and mentorship the member from Windsor to come So we'll be very pleased to know we continued with the support for big brothers big sisters Speaker we're moving forward in a responsible way I want to thank the members of my team and the ministry that worked so hard to make sure we Talked away all the Responsibility that the previous government absolutely buried in my name come door And we're moving forward with thoughtful investments that make a difference in the classroom Start the clock next question the member from Markham Unionville Thank You mr. Speaker my question is to the Minister of Labor Late last week our government was advised that the members of the power workers Union has voted to reject a new Collective agreement on Ontario power generation. This has left the PWU a strike position despite attempts at Negotiation over many months talks between the two parties have broken down a strike at OPG would greatly impair the stability of Ontario's electricity supply and has a significant adverse impact on the public interest Our government has to do whatever is necessary to ensure that Ontario has a steady and Interrupted supply of electricity can the minister assure the people of Ontario that the electricity supply will be maintained over the coming Winter months. Thank you, Mrs. Good Thank you to the member for Markham Unionville for the great question You know the people of Ontario elected our government put their interests first That is why yesterday I introduced legislation to send this dispute to arbitration and protect Ontarians homes and business so if passed our legislation will terminate any strikes or lockouts Between OPG and the power workers Union for the current round of bargaining This will prevent the effective shutdown of as much as half of Ontario's electricity system If this legislation does not pass mr. Speaker Families seniors and all Ontarians face the possibility of no heat or light during the cold winter months Mr. Speaker we were elected to fight for the people and that is Is doing restart the clock supplementary Thank You mr. Speaker. Thank you minister for the answer I know that our government is doing the right thing for the people of Ontario The minister of energy Estimate that a strike by the PWU workers will result in some or all of OPG's Facilities being shut down within weeks a situation that we cannot allow to happen mr. Speaker OPG is responsible for approximately 51 percent of all electricity generation of Ontario and Operates nuclear hydroelectric thermal and wind power Facilities we are facing a potential proviso emergency Speaker action is required now Ontario is not dreaming of a blackout Christmas Right, can the minister explain to this house why this legislation is so wide for Ontario's? Minister thank the member from Markham Univill for the question at 51 percent Reduction in Ontario's power supply is not something the provinces families seniors and businesses Can handle during the winter months my colleague the honorable minister of energy northern development in minds has already discussed This potential impacts of this reduction like rolling blackouts across the province Resulting in many families and seniors without heat or light during the cold winter months So speaker our government believes that disputes that arise during contract negotiations are best solved at the bargaining table Government should only intervene when the public interest and public health and safety are at risk and a resolution is not possible This is when negotiations reach an impasse or a deadlock This is the situation we are facing now member for Essex come to our post Legislation would prevent a severe disruption of Ontario's electricity that could result and endanger our pop My question is for the Attorney General last week the commissioner of the OPP wrote to the ombudsman saying that the OPP was Called by Dean French the premier's most senior political staffer to ask the OPP to hide the cost of a souped-up Man any reasonable person would agree that that needs to be investigated Will the Attorney General support the new Democrats request that the RCMP should investigate these allegations Mr. Speaker as the member opposite heard many many times for the minister of community safety and correctional services the Integrity commissioner has taken on the the work of investigating as the opposition is requested We respect the work that the integrity commissioner is going to do We we understand that there is great interest in this and making sure that the processes are followed and we welcome And we await the decision of the integrity commissioner, and we will follow his recommendations when he's made them The Attorney General has a responsibility to uphold the law and the principles of fairness and due process It's more important than her loyalty to the premier At least it should be as former RCMP commissioner Bob Paulson said about the allegation that the premier's chief of staff Wanted the the cost of the souped-up RV kept off the books if there's allegations of criminality Supported by some substantial evidence then that's a whole other question And that needs to be reviewed and that would require I think a separate force to do that not my words Bob Paulson's words does the Attorney General agree that the RCMP is ideally suited to investigate these allegations Mr. Speaker the member opposite should realize there are already active processes underway doing the work that the opposition is requesting the the the office of the Independent of the integrity commissioner is conducting an investigation an application For why don't you come to our member for us speaking a judicial review of the ombudsman's decision not to investigate member for us It's come to looking at that decision. Mr. Speaker. There are people who are doing the work The opposition is already asking us to do mr. Speaker We are here to do work on behalf of the people of Ontario to keep the lights on to keep the heat on and we wonder on This side of the house when the opposition is When there was still time on the clock I couldn't hear what she was saying because of the standing ovation from the government side once again Next question start the clock The member for Gwell Thank You mr. Speaker. My question is for the acting premier 18 years ago six people died and over 2,000 people were made sick as a result of drinking contaminated water at Walkerton There are people to this very day who suffer from the health effects of drinking contaminated water Justice O'Connor's report on the Walkerton tragedy led to the Clean Water Act So my question is why is the government putting people's lives at risk with legislation that would allow Municipalities to gut the Clean Water Act Questions to the deputy premier to the minister of the environment mystery the environment conservation Mr. Speaker and thank you to the member for the question mr. Speaker as the as the member knows just a few weeks ago We brought out a plan a made in Ontario plan that deals with issues like clean water that talks about many of the issues that he's quite Concerned about including sewage in the water system things that the previous government the previous government supported by the NDP did not Did not support the member also knows because he's very familiar very familiar with the Clean Water Act That the powers that that the mission has and are suggested in bill 66 are the same powers that he has Why the member from Guelph may want to distract from other issues when we should be focusing on keeping the lights on and keeping the power on Here in this in this legislature number for me This government's committed to making sure that the water is kept clear our made in Ontario plan includes Plans to make sure that we ensure that with proper source water protection and protection of water across this province With all due respect mr. Speaker section 10 of bill 66 Allows municipalities to gut the Clean Water Act What kind of business wants to invest in a province that will not protect his drinking water? What kind of government wants to gut regulations that protect people's lives? likewise the Greenbelt Protects our drinking water and protects our farmland people were loud and clear during the election campaign They want the Greenbelt protected so why is this government breaking their promise to protect the Greenbelt and introducing legislation that will allow municipalities to pave over the Greenbelt Minister the speaker the minister of municipal affairs minister of municipal affairs and thanks speaker member the opposition is Dragging the town of Walkerton through the mud just to try to score a couple of political cheap charter Their mayor has even indicated that the changes in our bill would not weaken nor will they jeopardize drinking water standards We have been extremely And again through through you to the honorable member. We are going to protect the Greenbelt We are going to not support any Municipal plan under the open for business tool that would do that We want to again reassure Ontarians that the safety of the people of this province. We take it very seriously We are going to continue to defend health and safety standards anything else from this member is just fear mongering shame on you Yet again, I'll say to the government side their minister at the floor there was time on the clock But when the standing ovation erupted, I couldn't hear what he said. I had to cut him off Start the clock the next question member for Mississauga milk Malton. Thank you, mr. Speaker My question is also for a minister of energy Miss speaker last week Ontario's for Ontarians found out that members of Power Workers Union voted to reject a collective agreement with Ontario power generation The power workers union issued the strike notice on Friday, which has put the entire electric system at risk Mr. Speaker this time of year families are coming together to celebrate the holiday season They need access to power to light up their homes to cook the turkeys. Oh, by the way Tofu Turkey for vegetarians like my wife and watch holiday movies with their loved ones We can't afford to let this job action threaten holiday plan throughout this province Minister, please explain why this is such a critical issue that requires immediate action by our government Thank you, mr. Speaker Thank you, mr. Speaker. It's it's day four a very serious day 21 plan to wind down the nuclear reactor Nuclear generators and dam units that that supply electricity for our province We have given the opposition two occasions already to short circuit the debate and make sure that the people of Ontario Have lights and heat for the holidays and as we head into the heart of winter But let me amplify the seriousness of this mr. Speaker from other stakeholders, mr. Collard Anderson the president of the Association Hamilton Business across Ontario expect that reliable affordable electricity is available when needed to keep our economy running Industry can't afford any disruptions that undermine the ability to produce the government must do whatever it can with generators and labors To keep That's exactly Thank You minister for your great leadership on energy fire Miss speaker, I'm proud to be part of a government that takes action on behalf of the people And I know my constituents appreciate us coming back to work to ensure that they stay safe and warm this holiday season however Let's not forget. We already seeing the opposition's cringe ways. They voted against unanimous consent for bill 67 And repeat voted against a bill that guarantees families staying warm and keep their lights on this holiday season It seems they don't think people across Ontario need and deserve a reliable power supply Especially over the winter months can the minister please tell the member of this house How of a government in since ensuring the people of Ontario can keep the lights on this winter to stay safe and stay healthy minister Mr. Speaker when 50% of Ontario's hydro supply is at stake we take this issue very seriously We appreciate the power workers union mr. Speaker They issued their right to strike their vote to strike and strike notice on Friday And they remain on the job and we appreciate that because we think they understand the importance of no interruptions during this critical season Of peak demand and temperatures getting colder mr. Speaker after eight months of negotiations Three votes mr. Speaker a rejection of the final offer on Thursday a vote to strike on Friday and the option for arbitration Mr. Speaker every right has been afforded to resolve this This is now less about rights than it is about lights mr. Speaker and this government is going to fight every day Mr. Speaker to make sure that the people of Ontario Families small businesses ready to celebrate Christmas and face the winter have the heat on mr. Speaker Start the clock for members for Brampton North. Thank you mr. Speaker. My question is to the Minister of Tourism and Culture and Sport On October 22nd while the Minister of Tourism Culture and Sport was still the Minister of Community Safety and Correctional Services The ministry posted to hire a new commissioner of the OPP It required that anyone applying had to have served as a deputy police chief or hire or Assistant commissioner or hire Two days later the posting was changed So mr. Speaker, I asked the Minister of Tourism Culture and Sport who decided to change the application Community safety and corrections mr. Community safety As usual the NDP are missing a few facts the facts are that it was an independent hiring committee That was was tasked with finding opposition come on a new OPP commissioner They've done that work They made a unanimous choice and now we are waiting a review of the independent officer of the assembly to do that You know, I lived through three days in a number of Christmases ago in my community when there was no power No heat no hydro. I don't want to do that again speaker I have a responsibility as a member of this government to make sure that doesn't happen again And I would hope respectfully that the member opposite also has that same responsibility The families who live in your community the families who rely in William Ossler Hospital the families who have seniors Living in Brampton who don't want to worry They have sufficient heat and Make sure they can stay in their own homes Supplement Thank You mr. Speaker my question once again is to the minister of tourism culture and sport Ron Tavener didn't meet the initial requirement for the posting, but then the posting changed and sharing he could Mr.. Speaker the minister of tourism Was the minister at the time of community safety and corrections? Can he explain why the government decided two days two days after posting? To water down a requirement that would have just happened to have prevented the premier's personal friend from applying for the post Who made the decision to change this posting? I feel like we need to talk about what the definition of independent is it was an independent hiring committee it was an Independent commissioner of the Legislative Assembly members of Timmons come to order Come day for of a strike that can shut down heat and light in the province of Ontario So if we want to talk about an emergency debate, I'm all over it But let's actually get to the process where we understand why we're here Why we need to ensure that the light and the power stays on in the province of Ontario? Thank you Thank You mr. Speaker my question is for the Minister of Health Station continues to make Short-sighted decision with public purse last week the premier the premier cut funding to Ontario's College of Midwives Speaker women want access to more midwife free services in Ontario actually 40% of women who request the midwives Here are unable to get one because there's not enough to meet the demand My colleagues children's I've had children's with the help of midwives Actually very important midwives improve health outcomes while bringing down Medical costs and this is exactly why I'm asking you this question mr. Speaker because yesterday I was in a retirement residence and Frank a senior could not Understand why this government was attacking our midwife services, so my question is very simple Can you please tell Frank and all of Ontario the reason why of these cuts? Mr.. Health long-term care I Thank the member opposite very much for the question and I can say that we agree that we value the support and the work that Midwives in Ontario perform But I think it's important to note that services performed by a widow lives are not being cut What is under consideration? Funding to the college the college is the only administrative body only college in Ontario That receives administrative funding for the province that is under review right now But I must drink I must reiterate to Frank anybody else who might be watching that the actual Services being performed by midwives will not be cut It is only consideration of at the services that the college might provide which is still under review So back to the minister this government by improvisation is not Improvising everything they have a plan they are deliberately Focused on making cuts that hit woman Children children and rights issues and that's not fair Mr.. Speaker the inflated deficit number they cooked up the one actually that the controller resigned and will not sign off on Can justify the waste of public money that will result from these cuts So I understand the minister when she says that at this point there is 800 midwives in Ontario There's an enormous burden on them as they are I would say almost creating jobs for you Lowering your costs on health care Why attacking this sector at this time while you know there's the demands and actually lowering our Minister Well, I have to reject the entire question Well what we were elected to do was to transform our health care system into one that's going to be Sustainable for the future for our children and grandchildren and that is exactly what we are doing So as far as midwives are concerned, of course, we value the work that midwives But we need to make sure that we can do so on a sustainable basis And they are continuing with the work they are doing it is only the question of Money to the college that is being looked at right now But I also have to say that this is an issue that we are dealing with that we are working on But we have to again come back to the reason why we are here We're clean up here to make sure that people can keep their Response make sure that seniors that people are living in northern Ontario people who are in long-term care homes in Hospitals will be able to be cared for and will be warm and receive the necessary Thank you Good morning, Mr. Speaker, and thank you my question is for the Minister of Infrastructure The previous liberal government attacked our frontline health care workers instead of ensuring that they had the resources to look after our most vulnerable Our families and loved ones were left languishing member for Hamilton East Stony Creek come toward waiting for beds hospital but for Eglinton Lawrence come towards My constituents in Cambridge and families across Ontario member for Hamilton East Stony Creek come to order deliver on our plan to end hallway Healthcare over the power for Hamilton East Stony Creek is warned crumbled due to mismanaged expansions and renovations While work on the new patient care wing at the Cambridge Memorial Hospital was stalled Renovations to the existing area have also been delayed Can the minister please update the house on how we are getting the Cambridge Memorial Hospital back on track? Thank you very much, Mr. Speaker, and I'd like to thank the member from Cambridge for that very important question Our government is firmly committed to making life easier for the families in Ontario for the Cambridge Memorial Hospital project Infrastructure Ontario was directed to deliver the work through the p3 model as they build finance project This new 240,000 square foot addition was supposed to be operational 20 months ago under the former liberal government This type of delay causes much anxiety in the local communities served by this particular hospital People were expecting better care to be delivered much longer ago I'm not happy with this project We inherited from the previous government because it's been delayed so long, but mr. Speaker We're going to fix it I know the local member from Cambridge who has been advocating hard on behalf of her constituents as well as the members from Kitchener's response and Kitchener Conestoga aren't happy either the people of Cambridge deserve better Speaker, there's positive news, which I'm going to share in the supplement Thank the minister for his response I am proud that our government is working hard to look after the needs of families and Seniors across the tri-city and Waterloo region they will soon have the quality health care that they deserve and expect Instead of sitting idly as the former liberal government did our minister of health and long-term care and the minister of infrastructure Have secured assurances that all parties are committed to moving forward as quickly as possible to complete the project I know I speak on behalf of the members from Kitchener South Hesbler and Kitchener Conestoga when I say that the minister of Infrastructure has been working hard to make sure that our government will continue to invite invest in the right infrastructure at the right time and in the right place Can the minister please elaborate on how the p3 model protects taxpayers and ensures that the project Thank you mr. Speaker and I'll tell you that my office has been in close touch with infrastructure Ontario the agency delivering this project on behalf of our government as you know the project is being delivered as a Public-private partnership or p3 model something that our government supports P3 projects offer certain protections to taxpayers one of those protections is that the company Contracted to do the work doesn't get paid until that work is complete There is being a recent development in the situation The project is now in the hands of a receiver who will ensure the hospital finally gets completed IO the hospital and the project lenders are working together and are committed to completing the project quickly So while the delays for residents in the Cambridge region are unacceptable We are assured by infrastructure interior that the construction issues are on their way to being solved at no additional Costs to the taxpayers in the province of interior Thank you. My question this morning is to the president of the Treasury board. Good morning minister, you know I spent months sitting on a committee supposedly focused on a fiscal transparency And your government the government to table the bill named restoring trust Transparency and accountability, but less than a month after tabling that bill We've learned that the premier's chief of staff asked the OPP to hide the cost of a special camper van For the premier's youth. I'm sure the president of the Treasury board would agree that that's not accountable It's not transparent and it certainly doesn't build trust. So my question mr. Speaker is Will the president of the Treasury board refer this matter to the auditor general for her to investigate Mr. Community safety and correctional services opposition come to order It amazes me that the NDP are So willing to throw around allegations in this chamber that are untrue That are will be proven to be untrue and that there is an independent investigation occurring right now So why don't you let that investigation happen and instead? Why don't we focus on what we are here to debate what we are here to discuss is to make sure that the power Stays on in the province of Ontario Friday is an important date and it's not just because Christmas is coming We have to make sure we have a responsibility as Legislators to make sure that the heat and the lights remain on in the province of Ontario That's what we're doing on this side of the house What the NDP are attempting to do? Well, mr. Speaker, I had to say I reject the premise of the answer Ontarians deserve clear answers about whether this was a one-off or part of a pattern Will the president of the Treasury Board be directing the Auditor-General to look into whether the Premier or his chief of staff Ask other ministries other agencies or boards to buy and to hide the cost of this camper van or any other items Let me try to Understand how this works. You do not agree that the integrity commissioner is able to do an investigation and and report on the process, but While you don't support the integrity commissioner, you were calling for the ombudsman to do an investigation Which of the independent officers of the legislation do you like? Which ones do you trust because I can tell you in our government we support and believe in all of them Appropriate to remind all members at this time to make your comments through the chair Start the clock next question the member for Niagara West Transportation, you know our government has promised to get the people of Ontario moving and we've already started to deliver on these commitments We're providing more reliable predictable journeys across the GTHA Rately improving the daily transit experience Speaker last week the Minister of Transportation made a very exciting announcement for the people of St. Catherine's Niagara Falls and frankly all of Ontario this announcement delivers on our government's commitment to get people moving And I was so excited to see the minister in St. Catherine's and Niagara Falls Can the minister please tell the legislature about his announcement in St. Catherine's and provide details on how we're implementing a core campaign promise I think the member from Niagara West for that question. I truly Enjoyed having met the side At that announcement. He's been a truly great advocate for the Niagara region as a whole And I know he'll just continue to produce results for the people living in that region So I also want to thank my PA from Tobacco Center King of Sermon who's also there in attendance It was a great day for the St. Catherine's area and I do have to note that it was something special to have Former house leader of the liberal side Jim Bradley the new chair of a Niagara region applauding our announcement As a member state or a government for the people made an important announcement for the people of St. Catherine's and I agris and mr. Speak mr. Speaker this marks the first time in history of the people in Niagara Falls St. Catherine's in Toronto will be connected by a regular weekday commuter train this train provide a comfortable seamless Go train trip between Niagara Falls Union Station with a stop at St Catherine's and mr. Speaker we are four years ahead of schedule on delivering Supplementary speaker. I have to thank the minister of transportation for the excellent response for coming down to Niagara for bringing the project Here to Niagara four years ahead of schedule truly truly impressive as a member representing the Niagara region I must say I'm deeply proud of this announcement for the people of Niagara Falls and St. Catherine's have been asking for go rail service for a very long time And sadly the previous liberal government plan to take an additional four years to expand the go rail service into the region However within only six months our government for the people delivered on this Commitment by using existing infrastructure and developing partnerships to get the job done Our government has now announced more than 200 new go train trips and over 400,000 new train seats every single week on the Lakeshore East and Lakeshore West rail lines And so can the minister tell us a little bit more about the expanded go service into the Niagara region As the members stated by working with a rail partner C and We have coordinated our schedules and are using existing infrastructure and we're able to introduce this new weekday service between Niagara Falls and Toronto The introduction of weekday rail service between Niagara Falls and Toronto is an important piece of work We're doing to expand go service to make life easier for the people that use public transit We know that efficient and reliable public transit is an essential part of Connecting people with jobs and promoting economic development across Ontario That's why we made it a priority to get go trains running to Niagara Falls as soon as possible And I'm pleased we've delivered on that commitment Our government for the people is doing this not only to get people in the province moving But also to create jobs and opportunities that make life better for Ontarians and mr. Speaker will be back in Niagara Falls to make more Thank You mr. Speaker this question is to the Minister of Health and long-term care They this conservative government announced with low explanation that they were cutting funding for the College of Midwives Speaker the College of Midwives order this for one reason Protect the public in this case member for King Vaughan will come to order born babies midwives Delivered and provide possible to care to 15% of on member for King Vaughan is more in doing so midwife Saves the government money save the hospital resources and they help save Ontario Hallway medicine crisis Can the minister explain why on November 8th her minister advised the College of Midwives that they caught that their funding was being cut Retroactive to April 1st. Why did your ministry send this memo? For the question and we do value the excellent services that midwives provide to women across Ontario In fact the issue that is under consideration right now is funding to the college and as I stated previously The College of Midwives is the only regulatory health college in Ontario to receive administrative funding from the province So that is under consideration right now, but the services being performed might buy midwives continue supplementary midwives have been historically discriminated against when it comes to fair pay these women Won a human right tribunal challenge this year to be paid fairly Now we find out that the conservative government is appealing this landmark human right tribunal judgment So this conservative government refuses to pay midwives fairly They refuse to support their college that protects newborn babies all Balancing the budget storm on Dundas, so clean Gary come go action are sending such a powerful and such a hateful message to midwives While at the same time every communities are trying to recruit them And we have a hard time recruiting people into the profession of midwives Can the minister explain why she is appealing the human rights decision to end discrimination and fair-pace for Midwives are doing and that is why we have told them straight out that we don't agree with the human rights tribunal Decision with respect to certain points, and that's why we communicated up front To the midwives that we in light of our disagreement with the decision with respect to liability and the Significantly different approaches both parties take in relation to the remedy that is being proposed We are too far apart on the issue of remedy for the negotiation to continue So we thought to be fair position come to the midwives It was fair to let them know that we were going to proceed and have the matter determined at the next level Question the member for girl My question is for the Honourable Minister of Children Community and Social Services Ontario's rural communities like Port Perry and Blackstock in my riding are some of the most tight knit communities across the province where Neighbours look out for one another However, these small towns are not exempt from sex trafficking and violence against women Police reported rates of violence against women are often higher in small towns and other rural settings than in urban areas Not only that but residents of rural and remote communities often have to travel further to access programs and support Speaker can the minister please explain what our government is doing to combat violence against women in rural communities Minister of Children Community and Social Services Thanks very much the Honourable Member for the very important question And I was very pleased to see her and the Minister of Environment last week take a stand and durham against human trafficking And I really want to say thank you for them As you know speaker our government has decided to invest an additional $1.5 million into funding for rural frontline services to strengthen service delivery Improve culturally relevant supports for of indigenous women and reduce geographic and transportation barriers And I'd be remiss not to say thank you to the to the Minister of Municipal Affairs and the Minister of Natural Resources for joining me Last Friday in that very important conversation Thank you speaker and I appreciate that our Minister and our government is working hard to provide survivors of violence that support they need in rural communities Ontario accounts for roughly two-thirds of police reported sex trafficking cases across Canada each year Many of those along the 401 corridor through my riding through Bowmanville through Oshawa When someone is trafficked they're moved frequently exacerbating the trauma of these already horrifying situations for survivors Returning to normalcy can feel impossible Can the Minister please tell this house how our government will continue to work with stakeholders and hear from those with lived Experiences to address these important issues Minister thank you very much speaker. I really appreciate the question. This is an important topic It's an important a piece of work that we're doing in this government And of course my our friend the Minister of Labor was very instrumental in making sure that we were having these strong conversations It is Ontario's dirty little secret sex trafficking of young girls as early as 11 I was pleased to both be in Renfrew Nipissing Pembroke and in Brockville on Friday to join my colleagues as we talked with people with Lived experience who are offering support to those who have been trafficked and let me be perfectly clear The work that this government is doing is going to continue to be robust We will work with other jurisdictions including our federal counterparts on a task force that That will bring this to the fore and speaker I must say I'm very impressed with many of those stakeholders across Ontario who are doing this important work and building on the 174.5 million dollar commitment this government made last week Member for Scarborough Guildwood on a point of order. Thank you speaker I would like to welcome school from my riding that is visiting Queens Park today West Hill Collegiate and 83 high school students will be here to learn about what we do The member for Kitchener Conestoga on a point of order mr. Speaker I just wanted to apologize for an interjection that I had made earlier if it offended anybody on the other side of the house They do apologize for that Point of order the member for Orleans Thank you, mr. President Today in question period the minister minister of community safety and correction services says that the integrity commissioner is in charge of that Investigation I look forward for the report because I know he will find that there was nothing wrong and I quote giving the nature of the investigation before the integrity commissioner Shirley standing order 23 g must be Interpretated to this matter the minister has Presupposed the outcome of the integrity commissioners investigation creating a real and Substantial presidents to the proceeding. I don't believe there is a valid point of order based on what the member has indicated It's a matter of opinion, but it's not a point of order I would remind the members so who I repeatedly called to order and had to warn that the warnings carry over into the afternoon And if the whoever's in the chair has to speak to you again, you may be named This house stands in recess until 3 p.m


You may be familiar from your childhood with the expression sticks and stones may break my bones But words can never harm me While that's a great sentiment to share with kids as they try and get over being called names and things We all know that's really a bunch of crap right sticks and stones can hurt your bones But so can words words can hurt very badly They can also help and that's the great thing about language But but language has a tremendous impact and that's what I want to focus on in this video The impact that language has in our life and the impact of verbal communication in our lives, so Let's start by talking about the impact as it relates to naming and identity We you know that names have a tremendous impact. That's why parents spend so much time agonizing over what to name their kids right and so But but it has to do with identity and can Have a very strong impact there and not just on individuals But on what we name groups for example think about the impact of of the names that have been associated with African Americans over the years and where those kind of Names for that group have come from Who established that name and who's able to choose that name and taking the power back in those names and and the pride that went Along with that identity of any group. It's not just African Americans, but any Cultural group even you know as we look at women We don't use the expression gruel anymore like they did in the 60s He's just call have the girl do it have the you know in the office You might just so have the have the girl do it or the girls will take care of it We don't use that anymore because it has a different Meaning that name and identity has a different impact and different purpose, right? so naming as an individual and as a group can have a tremendous impact and language can Be very powerful in that regard We also look at affiliation language can signal affiliation with a group or can signal Disaffiliation with a group meaning separation from that group. So for example, we look at affiliation When someone adopts the language of a particular group, it's something we call convergence They accept that and they really that indicates that they're Desire so being a part of that group You see this a lot for example in the military the military all the branches of the military kind of had their own language Right that they use different words for specific things and they really indoctrinate people when you enter the military You were trained to use these words part of that is is for clarity when they're talking about things, but the other part is for Affiliation for that convergence. They want people to really use that language to signal that they are a part That particular branch of the military that part they're part of that unit They're kind of buying in to that affiliation as opposed to if you know There are groups that may have language that you refuse to to use that you refuse to adopt that is what we call Divergence signaling, you know a lack of affiliation. I am not a part of this group and so I'm not adopting that language So language can be very powerful in the sense of affiliation as well it can also as we don't have a great deal of power in terms of Establishing power and when we use a particular type of language We use that to express power over somebody else or to establish power over somebody else Conversely can be used for politeness language can be very Helpful in in being polite the way we choose to phrase something that really indicates kind of are we giving an order and establishing power Or are we asking for something? Are we being polite? Are we you know that so the different words that we choose can can really signal different things there? And then finally, we know that languages obviously very much a part of sexism and racism Will be choose particular language it indicates, you know sexist or racist views and so forth and where the lack of those things would identify more More evolved view of those things so sexism and racism very much connected to language and language has a very big impact on those areas Language also has an impact in terms of precision and vagueness Language can be very very precise or it can be very vague and abstract So what we think look at things like ambiguous language sometimes we choose to be Unclear and we use that as a strategy and other times where ambiguous we don't mean to be and it causes confusion But we need to be aware of that We can also look at abstraction against we can make choices regarding abstraction. There's what we call the ladder of abstraction Which you can see here and that You know one end of the ladder has very abstract language and an abstract idea of more vague The other end is more concrete detail very specific So if we look at the word war more is very abstract mean a lot of things from you know armed conflicts to the game That you play with cards and even if we just narrow down to armed conflict There's a lots of different wars, right? But if we could get more and more specific as we go down the ladder of abstraction toward that concreteness We see that we can be more specific by identifying World War two for example that excludes all the other wars and focuses on that one Still a lot there though We can be more specific by talking about D-Day or specifically the beaches at Normandy, right? So we get more and more concrete as we get to the other end of that ladder and get away from abstraction I'll get abstraction sometimes as a strategy depends on what we're trying to accomplish Sometimes we want more abstract language and other times we ought to be more concrete So we need to make appropriate choices with our language in that regard Sometimes we also use euphemism as a form of vagueness, right? It's sometimes not pleasant to talk about things like when somebody dies. It's it's it's can be Not an easy topic to address so we use words that are a little softer expressions that are a little softer We call that euphemism so instead of saying somebody died may maybe we say they passed away or they passed on They've they've gone to heaven so forth Those are euphemisms all to express the fact that somebody's no longer living but it softens that up a little bit What's our relative language if I were to ask you, you know, did you come from a small town? Some people would raise their hands and say yes, and then we would ask, you know We can ask how small a town and some people would say, you know Well, I'm from a town of only fifty thousand people and they consider that small other people would say one from a 500 people and that's obviously small but really just depends on you know If you're from that town of fifty thousand people, but that town is near a city of, you know, two million people Then it's gonna seem small right in in comparison. So language is relative or if I said, you know, I'll be there soon What does that mean soon as a relative for me? It may mean tomorrow and for you It may mean in five minutes. So language is relative can vary in that precision of vagueness as well Well, so the precision of vagueness of what we call static evaluation Which which kind of implies that something never changes that we once we have an opinion of something We assume that and a person for example, we may assume that that it never changes that person never changes But we know that's not true so we need to be cautious of saying well this person is this and Expressing that in absolutes Whereas we want to say well, you know in my opinion or last time I was around this person They were kind of like this As opposed to this this constant because very little in life is absolutely constant So we need to be cautious when we're using static evaluation We know that language also has an impact in terms of gender So there's two different approaches that people take this one is that there are significant differences in Between the genders and language. It's where you can put the idea You know this whole book that men are from Mars women are from Venus like they're so different Fundamentally different You know masculine and feminine communication are so different that they're from different worlds The other approach though says they're not that different It's more like men are from North Dakota and women are from South Dakota But there are minor differences, right? And you know in the end we the verdict is that you know We're coming more and more around to is that Gender really isn't something that is in communication isn't something that's that's hardwired into either the genders That it's more about socialization that over hundreds of years men and and you know the masculine gender have been Socialized to communicate in a certain way and the same is true for those with a feminine gender have been socialized to Communicate in a particular way, right? So But it's not really about masculine versus feminates about what have you been taught to do and how you've been socialized as a Communicator and so those differences really don't exist in you know in a hardwired sense In men women or masculine and feminine genders they exist in the way that we've been taught to communicate Which makes those differences really? More minor than than major There are things that can be overcame can be changed and have changed over time So now that we know a little bit more about the impact of language. Hopefully you'll You'll Consider that more as we use verbal communication as we consider the way that we use language specifically And and just bear in mind the impact the language have that it can be just as powerful as those sticks and stones If you have questions about The impact of language or anything else related to communication. Please feel free to email me I'd love to hear from you there in the meantime I hope that you will give great consideration to your language use and the impact that that can have as a communicator You


David Copeland. David is returning. This is his second year here. Last year he came and gave us a really great talk on doing test-driven development of command line applications in Ruby. He wrote a book on that published with PregProg, right? Yep. And now he's at Living Social and he's gonna talk to us about service oriented architecture wackiness. Thank you, David. That's right. Thanks. Thanks. Right. So here's the title of my talk. Services scale, backgrounding and what is going on. So this is really gonna be a story about reasonable developers making reasonable decisions, doing reasonable things as they move away from a monolithic Rails app and allow their architecture to scale and be more managed and handle more things and handle a larger team and all that involves. And despite everyone in this story making reasonable decisions, things will go wrong and strange things will happen and we'll talk about how to deal with that. This is based on my personal experience at Living Social. I work on a application that we call payments and every single time someone buys something on Living Social it goes through this application. So you can imagine it needs to work, be fault tolerant, be running, be monitorable, all that. And it was all extracted from a monolithic Rails app. So there's all this code that was expecting to run in process synchronously and now all of a sudden it's been yanked away from that and has to run asynchronously across several different processes and several different services and so a lot of weird things happen. So let's begin our story. Our hypothetical business, you know, we're trying to get users to sign up and buy stuff from us and all that. So the first thing we've got to have is a controller that lets people sign up. So in our hypothetical business, we don't want people to just sign up and use the site. We want to send them an email and they need to click on a link in that email to validate their email address and then their account is activated and they can use the site. So you can see we have a pretty vanilla Rails controller with just a little extra user-mailer thing sitting in there but that's, you know, pretty straightforward. And this is awesome. It was easy to write, easy to test. We got it deployed. We got people signing up. This is great. This is why we're using Rails. It's great. But we notice after a while there's a little bit of a problem. So let's walk through how this controller works and maybe some of you have seen this example before. I stole it from someone else but you submit the user info, get saved to the database and then really that should be it. You should go on your way to the next screen or whatever it is you need to do but this mailer is happening. So we've got to send this email and only when the email has been sent is control return to you. So this isn't a great user experience, especially if we were under high load. But it also makes it hard for us to manage our resources, right? So suppose TechCrunch posts about our awesome new service and a bazillion people go to sign up. Well, the reality is we don't really need those emails to go out synchronously with the people signing up. The emails can be sent like pretty soon but later. So we want to be able to allocate our resources to maximize the user experience. The way we've implemented this controller, we can't do that. So let's fix that. So we use background processing. We'll take the stuff that doesn't need to happen in sync with the user, namely sending the email and we will put that, we want to run that in some offline task. So we've decided we're going to use rescue and so we just change our mailer to use this line of code. If you don't know about rescue, briefly what it does is this is creating a job that will be serviced by the new person event class and it will be given the person's ID when it's run. This will jam that into JSON and shove it into Redis which is a super fast key value store. So this call is going to be super fast, way faster than that mailer call. In the other end, we've got another process that will be running to process all of these things that we've put into Redis and so rescue, the polar will find this class and it will call perform and you can see what it does. It finds the person in the database and sends an email. This is good, right? So now we can allocate things for the users to get the user experience as good as possible and we can manage all of our background processes separately even on a different machine if we want. This is good. We've got configurability, flexibility in our architecture, ability to scale under certain conditions. So this is a good thing. So a few months later, we've configured our application so if anything goes wrong, we get an email about what went wrong. So a few months later, we get such an email that this line of code here inside our controller generated a timeout, meaning when it tried to talk to Redis to put this job in there, it timed out and blew up. So this doesn't happen often. I mean, I see this happen more than I thought it would happen and it does happen. You can never prevent it from happening. So let's think, given that this happened, what is the state of our system right now? So a user account has been created in the database but that email, right, they need to click on that email so that they can validate and use their account. Well, they're never going to get that email and so we've got this account sitting around that just can't be used and what's worse, they didn't tell you but we have a unique constraint on the email field in the database. So if the user just like refreshed or filled it out again or came back another day later and filled it out again, it's not going to work because their email address has been taken because of our unique constraint. So these were all good things that we put in place and they've all kind of come together to create a weird situation. So how do we fix this? That is how we have to fix this. Production console is great in many ways, right, because we can deploy things to production without having to think of every crazy edge case that could possibly happen because we know if they do, we can go in and we've got the full power of our application to fix it manually in those weird cases. But we're putting the business at serious risk inside production console because you can do all kinds of damage. You can really screw things up. So if we're going in here for the same thing too many times, it might be worth trying to find a code solution to the problem. So what's the simplest thing we can do to prevent this weird state that requires manual intervention from happening? So what we want, ideally we want the person to be created and the email to get sent. That's the perfect solution. But if that can't happen, we would like neither of those things to happen because at the very least, if neither of these things happened, then the system is in the state it was before. It's not broken. We don't have to go in a console to fix it. This would be better than nothing. So we will use database transactions to do this, right, because when we make a person that's done in the database and the only other thing we're doing is sending this email. So we go into our controller. So person's an active record class and as you know, they all have a method called transaction. It takes a block. And if anything goes wrong in that block of code, all database operations are undone, which is exactly what we want, right? If the person create fails, okay, that failed, we're fine. Person create succeeds, but then we have any failure in queuing our job to rescue, then the entire person will not be created. Their email address will not be saved. Everything is, it's okay. I mean, the user still has to deal with a 500 error. They still have to resubmit, but at least they can fix it. We don't have to go in a console and take manual steps to fix this problem. If we continue getting these timeouts, obviously, we have a new problem and this solution might not fix that, but we're at least making things better. So now that we've done this, we don't see these timeouts anymore. Or rather, we don't see this bad data situation cropping up. And we get an exception in our job processing class. So in rescue, when something goes wrong, the job itself goes into a special queue called the failed queue where you can inspect it and you can see the exceptions and the stack traces that happened that put that job there. And you can replay them. So the idea is a transient error, like a timeout or a network failure, you can just replay that and everything will be fine. This is not a transient error, so it seems. So we go into the database and we see the person with this ID is in the database. So whenever this actually executed, the person was not in the database. But we got that ID from the database. So how could that possibly have happened? No one's inserting jobs on our behalf, no one's deleting users, we replay this and it works fine. So what went on? Let's play out the code and how it might have occurred. What could have happened to cause this? So we got our ID right from the database and then we created our event. So the second we created that event, we have this other process running, this polar, and it sees the job and it's like, right on, this is what I'm here to do, I'm going to process that job. So it does that, but the transaction from over here is still has not committed yet. So while we're in that transaction, the ability to roll it back and to undo all those changes is made possible because no one can see what's going on in the database outside of us. But we've sent the ID outside of our transaction to someone else who then can't see what we've been doing to the database. It's a little race condition. I see this all the time. We could solve this maybe by not using rescue, by picking something else and who knows what problems that would come with. That sounds like a lot of work. Is there a way we can fix this so we see this stop happening? So we could assume that if we get this sort of error, the person is not in the database when the event fires, we could assume that we're currently experiencing this race condition. And if that were the case, we could probably just like wait a little bit and try again and probably everything will be consistent. So we're going to assume we've got a library called Rescue Retriotron7000 that handles this for us. And I had another slide that was a big bunch of while loops and pluses and it's totally not interesting. So the point is we're setting up a condition and a condition that we expect might not be met at the time the job is processed, right, person.nil. And so if that happens then we'll retry and we'll wait a little bit and we'll limit the number of times so that we don't get into some infinite loop of retrying. And, you know, it's hard to argue like this is amazingly clean, beautiful code, but it does work and it does solve the problem and it wasn't that hard to create. Because in reality, like, this race condition is probably going to complete in one try, certainly by five. Anything that gets through either means we need to retry more or we've got a new problem that we need to solve that this isn't solving. But we didn't have to like rip out Rescue. We didn't have to grand re-architect anything. We just had to add a little bit of code to help make everything kind of consistent before we executed it. So again, I would say this is a reasonable way to solve this problem. So continuing the story of our company. We've gotten so successful. We're making all this money. We're going to buy our competitor, right? We're just tired of dealing with them.  So we need to get their users into our database. Now, our competitor did not have the requirements for validating email addresses. So what we want is we want to create all these records in the database and have welcome emails sent to all of them so they can all click on them and validate that they are who they say they are and all that stuff. Right? Basically, we want the same business logic to happen as if they signed up on the website. But we're being given the data already, so the users don't actually have to sign up. So if we were to state this another way, we could say that after we create a person, we want to run this business logic, which is currently just sending an email. So I would say reasonable way to do that, but use the after create active record hook. This basically says every time a valid person is created, inside a transaction, we will run this method that we specified here, send new person event. And that method will enqueue our job. So now our little bulk uploading thing, all it has to do is create person records. And this happens automatically. And there's another benefit is that our controller loses all this cruft about transactions and enqueuing, and it goes back to being super clean and simple, like even better than it was before. So this really feels like it was an improvement, right? I mean how often does a new requirement actually improve the code base, this kind of feels pretty good. Now, if you ever use active record callbacks, you might not like them. I will not argue with you, I don't like them either, but it's hard to argue that this like wasn't reasonable, right? There's other ways we could have done this, and if we really sat down and hammered it out, maybe we could find one that was definitively better than this. But I would say that this was not wrong. Like it seems logical to find wondering where the logic is about creating people that's in the after-create of callback. That seems logical. I mean Rails provides it for a reason for us to use. So we will see how this decision affects us in a moment, but the point is this was a reasonable way to solve this problem. So a few months later, right, our team is growing. We've got a team that's going to like log some stats and like set up some sort of monitoring of what's going on, and they want to know every time we create a new person, so it shows up in this nice little graph, there is a juicy method that they can just throw that right in there. See, one method, one line, pretty easy. They got their job done in like two minutes. A few weeks later, we decide we need to have a cache of all the people's names that have signed up, and what better place to put that than in the send new person event which is called from after-create. So now another line of code was written, not too bad. Of course we've got this Skunkworks project. We don't know what they're doing. It's kind of crazy with like a Markov chains and weird Bayesian networks, and they got to hook into this process somehow, and we don't totally know what they're doing, but they have to add their lines of code in here as well. So now, right, we have a method that's got a lot of weird stuff and it doesn't seem to have anything to do with anything. And, but you know, I flashed through these in a few seconds, but you know in reality this was like potentially months, months of time has elapsed, and thousands of lines of code have been written, and only three of them ended up in our poor abused method. And so you might say that the person that put this, I mean come on, they should have, they should have cleaned this up, right? Well I don't, you know, I would say it would be unreasonable to have expected someone to like re-architect this thing just because they put one too many methods into it, right? The business didn't necessarily need them to spend a week fixing this dirty method when they could spend five minutes adding what they needed to add and move on with what they needed to do. I mean that's the definition of technical debt, right? We as a business were willing to accept this crappy looking method because we got business value delivered more quickly. So someday maybe we'll fix it. In the meantime, in other parts of the organization, right, this is what happens when there's lots of people, there's lots of things going on at the same time, you know, parallelism in the company is just as weird as in the computer. So we've decided that we don't like mailers, right? All of our Rails apps are using these mailers and half of them, like the mail is not going through, it's getting a spam filter, the other half, it's working fine. We need to centralize this and have it in a single controllable place. So mailers are gone, new apps will not use them, and we're going to migrate existing legacy apps to use our new awesome mail service. And the team that is designing this has gone to great lengths to make it just a drop-in replacement for the mailers that we're all using. So they've made it so that we don't have to add any extra crap to our app, just a little bit of configuration and replace one simple call with one other simple call. This is going to be an easy migration, so we think. So to get around to us, and so here's our new person event, and gone is the user-mailer call, now we're calling mailers service, right? And it looks pretty much the same. You know, things are in a little bit different order, but it's pretty much the same, it's pretty easy to understand, it was pretty easy to get in there. Now if you've ever done this, you know that it's not as simple as just flashing a couple of slides by, and it actually takes a while, especially if you're the first app that has to use some new service, you might have to go back and forth for finding the API, making sure that it's going to work. So while that was going on, right, there's another thread of things where someone has decided that that method we saw a few slides ago, they don't like that. This is terrible.  Here is their solution. Remove these lines. So now this method does exactly what it says it does.  So this seems a lot more logical. All of this stuff is now running in an offline process where we don't care if it takes a little bit too long, and we don't have to mock this crap out, we're using people, objects in our tests, we, and it seems more central, right? Before we had the business logic of a new person kind of split up. So now it's more in one place, and it does seem logical that stuff about making a new person would be in the new person event. So this feels like a really good change, and so we're excited that this person took time to do it for us and fix and clean up our application. So we've integrated the mail or service, we've taken care of this technical debt, we go up into production, and we see an event has failed. Events fail not all the time but on occasion, right? Because there's certain transient problems that happen. So what happened in this one? You know, normally we replay these because they just get fixed, but this had a little bit of a weirder failure mode. So we sent mail, the mail or service call worked like a champ. Paying the stat server, so our dot on our graph is going to show up no problem. But then when we went to warm up this cache, some weird thing happened in the network and it just blew up. So the whole thing just died. So now we have an event that's half played, like part of it was played and part of it hasn't been. So we can certainly fix this in production console, but we don't want to be in this situation at all. I mean this is bad. So we could take every line of code and put that in an event that calls the event for the next line of code and so on, like we could do that, but that's why we're not using node. That's terrible. We want our code in the order that we wanted to run. So if we were to replay it, right, obviously we know what's going to happen. The mail is going to get sent twice, and then the user gets two emails and they have two different unique values for some token and one works and one doesn't. And who knows which one they're going to click on and they're going to call customer support and then we're wasting time on that because we couldn't solve this problem. So how could we? We could certainly code around it. It's going to be a little more complex to code around it and aside our app. And I would say that the real problem is that the way we did the mail services design, it's too dumb, right? We spent all this time making it a drop-in replacement that is really easy to integrate with, but yet it lacks some useful features that would allow us to not have this problem of having a half-played sort of thing. So what things could the mail service have included that would make this more helpful? Well, the calls could be idempotent and that means that you can call the call a million times, but it's only going to have an effect once. That would be darn helpful if we called, every time we called mail, it just only sent one mail to the user. Like, if that was what the mail service did, that would be helpful. Now, the mail service doesn't know, I mean, how's the mail service going to know which emails to send and which ones not to. So, talk about that in a second. Another thing that would be helpful would be if the mail service exposed some of its internal state to us. So I could ask it, did you send this email? If you have, cool, I will not ask you to do it again. But if you haven't, then I'm going to do it, right? These two things, either or, would have been pretty helpful. So for making it idempotent, like the way that we would implement that without the mail service having to know the business rule of only one welcome email being sent per person, is we could have the mail service require a request ID. And it would promise that it would never send mail more than once per request ID. So as long as we, the client, generated a valid request ID that was unique for the thing we want to be idempotent, everything would work. And that would be pretty easy, right? The name of the email and the person ID, that would have probably worked for us. And like I said before, right, you can call it a zillion times and we would get the same result back every time. So we wouldn't even know that we've called it a zillion times. That would have been really helpful. That would have solved this problem and allowed this event to get replayed. If the mail service instead couldn't do that but wanted to expose its internal state to us, right, what emails have you sent, and then the client can check before, you know, that would work too. Not ideal, but it would definitely work.  The other changes that we saw were pretty small and they weren't too dirty and we could do them all within our app. But here we have to redesign the mail services API and so there's like, that's kind of a problem and then, you know, you've got a three-month-old service with V2 already. I mean, it's not, you know, would have been nice if we thought about this maybe a little bit more before embarking on this part of our journey. But we didn't. So now we're starting to get paranoid, like what if the mail fails at the gateway? We said it got sent but then it didn't actually ever get sent. What if I forget to check the internal state beforehand or some client like doesn't get that right? What if two requests come in at the same time? There's a race condition there, then two mails can be sent because that might not work out. What if two apps generate the same request ID and so one of them sends the mail and one of them doesn't but he doesn't know that because, you know, like this is just crazy. You can get out of your mind trying to think of everything that could happen. So and the bad news is that you're never going to get it fixed, right? You can't make it perfect. You can't prevent every weird thing from happening. What you can do is try to have a better understanding of what's going on so that you can kind of evaluate how to solve these things and when when they're happening. Okay, so that's the end of our story and now we'll talk about some like real things that you could do given that you might now be paranoid about using services and background processing. So the first thing super helpful is to have an historical record of what happened, right? So Rails has a logger that doesn't have time stamps. It uses a multi-line format and has ANSI escape codes. So you gotta you gotta fix that and you gotta start using your actually useful logger to log things about your app. Rails is great at logging like what it's doing and that's good but you need to know like what your app is doing too. Business logic that's happening, paths that were taken that might be interesting. Just think if something important fails, what information would you love to have had to figure out what went wrong and then log that? If it's feeling expensive, do it a debug and turn debug off by default but really put logs in and then only take them out if you really need to for performance reasons. With that there's certain tables in your database that are important like an order or a person or something like that where mutation of those rows you might want to know about it. So you can audit that. You can figure out who changed that. What did they change? When did they change it? Maybe even why they changed it. And these two things together can allow you to piece together exactly what happened at some point in your application's history. You don't have to sit there and try to reason about what order things happened in. That's what we had to sort out some of these problems. If we had a log we can just see exactly what happened and in what order. So that is super helpful and it's often not the order you think it's going to be. Secondly bad data. You do not want bad data in your system. Active record is not, active record validations are not a way to prevent bad data from getting into your database. Active record validations are great at getting a user to give you valid data in a web form. But they can be easily circumvented. You can just go straight to the database and not even use them. You can use things like uniqueness that don't even work. You can't rely on this only. You have to have this because this is good for usability but the database you know put constraints on the database. If a field can't be know make it not know. If one record should always have a related child record make a foreign key constraint. Something should be a number make it a number. This way no matter what your code is doing you know the database is going to keep things in order and it's going to keep the data good. Now database constraints are very simplistic especially if using MySQL you don't have very sophisticated checks that you can run. So in conjunction with database constraints. Sanity checks write some scripts that go and examine the state of your system and see if things that should never happen have happened. And then email someone that that is the case. Run this in cron all the time. And then when it comes back with something don't code around it like fix it. It might take longer to fix it than to code around it but it will pay off easily down the road.  Now along the lines of fixing bad data are the second thing that can go wrong which is errors in your app. If your app raises an exception that is unhandled that is a bug in your app and you should email the team the whole department the universe I don't know but the point is an email from your app about this should be we got to fix this we got to stop what we're doing and fix this problem right now because the app has a bug and it's preventing the user from doing something that probably is important to your business. Now some of these right we are realistic not every bug is worth fixing not every problem is significant enough to stop development of new features and fix this bug. So you want to codify that decision by downgrading those errors to warnings so that they are not filling up your inbox with unactionable bits of information. You want information you want emails from your app to be actionable and you know like I said read alert. Finally when you're getting around to extracting the services right don't just be dumb I think it's worth spending a little extra time thinking of some failure modes that might occur with the service and for each of those ask yourself like how serious is this if this happens what would be the state of the system with this happens and how do we fix it.  You know item potents is a great way to do it the system I work on certain aspects are not item potent and I didn't even think about what that even was initially and now I wish it was because there's a lot of complexity around preventing these bad things from happening. What I do and why I concluded this is my service does provide some introspection API so that the client can figure out what's going on and possibly be a little more self healing. So this is an easy way to do it if you've already got something in place and item potents is going to be too complex. Okay so this is about it record your history prevent bad data fix errors that happen or downgrade them to warnings and make your services a little bit smarter. So if this sounds like fun of these problems sound like they're really fun to deal with or to experience I don't know how would I answer this question but I have really enjoyed solving these wacky situations living socials hiring as I'm sure you're aware come talk to me. I wrote this book it has nothing to do with anything in this talk. But I'd love if you bought a copy of it. And that's it the slides are online and that is all I have so thank you. Great we have time for a question and maybe two really quick ones. I really thought I'd use up all the time so I wouldn't have to answer any questions. For the problem of the rescue job where you have to retry it. Did you guys consider using after commit which is new in Rails. Yeah so in a lot of places after commit does solve that problem pretty well. Unfortunately some of our apps in Rails too so they don't have that. So that's kind of where this came from. And then all Rails 3 apps were like written as if there was no such thing as after commit so we've been learning about after commit. One more. Okay that's it. Cool thank you. Thank you very much.