pembrolizumab and palliative radiation therapy in treating patients with metastatic esophagus, stomach, or gastroesophageal junction cancer

Conditions: Gastric Adenocarcinoma; Gastric Squamous Cell Carcinoma; Gastroesophageal Junction Adenocarcinoma; Metastatic Malignant Neoplasm in the Stomach; Stage IV Esophageal Adenocarcinoma AJCC v7; Stage IV Esophageal Squamous Cell Carcinoma AJCC v7

Summary: this phase ii trial studies how well pembrolizumab and palliative radiation therapy works in treating patients with esophagus, stomach, or gastroesophageal junction cancer that has spread to other parts of the body. monoclonal antibodies, such as pembrolizumab, may interfere with the ability of tumor cells to grow and spread. palliative radiation therapy, such as external beam radiation therapy, uses high energy beams to treat symptoms that are caused by tumors. giving pembrolizumab together with palliative radiation therapy may work better in treating patients with esophagus, stomach, or gastroesophageal junction cancer that has spread to other parts of the body.

primary objective: i. to establish that the combination of pembrolizumab and traditional external beam multifractionated radiation therapy (rt) to the primary tumor or a single target metastatic site of patients with metastatic gastric, esophageal, and/or gastroesophageal junction (gej) cancers will lead to an increase in tumor infiltrating cytotoxic t-cells and circulating cytotoxic t cells and a reduction in immunosuppressive regulatory t cells (tregs) and myeloid-derived suppressor cells (mdscs) in metastatic sites. secondary objectives: i. to establish that the combination of pembrolizumab and rt is feasible in the patient population and evaluate toxicities per national cancer institute (nci) common toxicity criteria for adverse events (ctcae) version (ver.) 4.03. ii. to evaluate overall response rate (orr) per response evaluation criteria in solid tumors (recist) 1.1 and immune related (ir)recist in this treatment population and correlate with tumor t-cell response. iii. to evaluate progression-free (pfs) and overall survival (os) in this treatment population. exploratory objectives: i. to measure changes in whole genome serum micro ribonucleic acid (mirna) signature before and after protocol therapy and correlate with tumor/immune/stromal cell mirna expression profiling determined by deep sequencing. ii. to measures changes in fecal and oral microbiomic diversity and correlative with orr, pfs, and os. iii. to assess germline mutations in a panel of mirna regulatory genes using the miradx assay as predictors of response and toxicity to pembrolizumab and rt. outline: initial treatment: patients undergo palliative external beam rt daily. on day 1, patients undergo the first rt fraction and then receive pembrolizumab intravenously (iv) over 30 minutes. cycles repeat every 3 weeks for up to 35 cycles in the absence of disease progression or unacceptable toxicity. second phase: patients who achieve a complete response, stop study treatment, and then experience radiographic disease progression may be eligible for the second phase at the discretion of the investigator if no cancer treatment was administered since the last dose of pembrolizumab and trial eligibility safety parameters are met. patients receive pembrolizumab iv over 30 minutes on day 1. cycles repeat every 3 weeks for up to 17 cycles in the absence of disease progression or unacceptable toxicity. after completion of treatment, patients are followed up at 30 days, every 6 weeks for 1 year, and then every 9 and 12 weeks for up to 2 years.

Eligibility criteria:
inclusion criteria: * documented informed consent of the participant * willing to provide tumor tissue amenable to ultrasound or computed tomography (ct)-guided biopsy for biomarker analyses * patients with malignant ascites are permitted to participate and provide ascites samples for biomarker analyses * patents receiving radiation to a single metastatic site in which only the primary tumor is accessible for biopsy by endoscopy will also be eligible * eastern cooperative oncology group (ecog) performance status of =\< 1 * life expectancy of \>= 3 months * diagnosis of metastatic squamous cell carcinoma and/or adenocarcinoma of the esophagus, gastroesophageal junction, or stomach in need of palliative radiotherapy to the primary tumor or a single metastatic site for symptoms such as pain, dysphagia, and/or gastrointestinal bleeding * patients with adenocarcinoma histology and known human epidermal growth factor receptor 2 (her2) overexpressing disease are permitted to participate if the progressed or are intolerant of prior trastuzumab-containing therapy * measurable metastatic sites of disease outside of the target lesion undergoing palliative radiation based on recist 1.1 as assessed by the investigator * have no limits on prior lines of therapy or may be treatment-naive if in need of palliative rt provided the patient has not received prior anti-programmed cell death protein 1(pd-1), anti-programmed cell death 1 ligand 1 (pd-l1), or anti-programmed cell death 1 ligand 2 (pd-l2) therapy * absolute neutrophil count (anc) \>= 1,500/mm\^3 * platelets \>= 100,000/mm\^3 * hemoglobin \>= 9 g/dl * may receive transfusion to meet this goal * total serum bilirubin =\ 1.5 x uln * albumin \>= 2.5 mg/dl * aspartate aminotransaminase (ast) and alanine aminotransferase (alt) =\< 2.5 x uln or =\< 5.0 x uln if liver metastases present * serum creatinine =\ = 60 ml/min if creatinine levels \> 1.5 x uln * glomerular filtration rate (gfr) can also be used in place of creatinine or creatinine clearance (crcl) * if not receiving anticoagulants: international normalized ratio (inr) or prothrombin (pt) =\< 1.5 x uln; if on anticoagulant therapy: pt must be within therapeutic range of intended use of anticoagulants * if not receiving anticoagulants: activated partial thromboplastin time (aptt) =\< 1.5 x uln; if on anticoagulant therapy: aptt must be within therapeutic range of intended use of anticoagulants * negative urine or serum pregnancy test (female of childbearing potential only) * if the urine test is positive or cannot be confirmed as negative, a serum pregnancy test will be required * female of childbearing potential: willing to use 2 methods of birth control or be surgically sterile, or abstain from heterosexual activity for the course of the study through 120 days after the last dose of study medication * childbearing potential defined as not being surgically sterilized or have not been free from menses for \> 1 year * male: use an adequate method of contraception starting with the first dose of study therapy through 120 days after the last dose of study therapy exclusion criteria: * anti-pd-1, anti-pd-l1, or anti-pd-l2 agents * prior radiation therapy within the field of the target lesion that in the opinion of the treating radiation oncologist would preclude further palliative radiation to a dose of 30 gray (gy) * anti-cancer monoclonal antibody (mab) within 4 weeks prior to study day 1 or who has not recovered (i.e., =\< grade 1 or at baseline) from adverse events due to agents administered more than 4 weeks earlier * chemotherapy, targeted small molecule therapy, or radiation therapy within 2 weeks prior to study day 1 or who has not recovered (i.e., =\< grade 1 or at baseline) from adverse events due to a previously administered agent * note: subjects with =\< grade 2 neuropathy are an exception to this criterion and may qualify for the study * note: if subject received major surgery, they must have recovered adequately from the toxicity and/or complications from the intervention prior to starting therapy * live vaccine within 30 days of planned start of study therapy * note: seasonal influenza vaccines for injection are generally inactivated flu vaccines and are allowed; however intranasal influenza vaccines (e.g., flu-mist) are live attenuated vaccines, and are not allowed * immunosuppressive therapy within 7 days prior to the first dose of trial treatment * investigational device within 4 weeks of the first dose of treatment * currently receiving an investigational agent * about to undergo palliative radiation for a symptomatic central nervous system (cns) metastasis * systemic steroid therapy * hypersensitivity to pembrolizumab or any of its excipients * diagnosis of immunodeficiency * active autoimmune disease that has required systemic treatment in the past 2 years (i.e., with use of disease modifying agents, corticosteroids or immunosuppressive drugs) * replacement therapy (e.g., thyroxine, insulin, or physiologic corticosteroid replacement therapy for adrenal or pituitary insufficiency, etc.) is not considered a form of systemic treatment * known history of, or any evidence of active, non-infectious pneumonitis * current active infection requiring systemic therapy * known history of active tuberculosis (tb), human immunodeficiency virus (hiv) 1/2, hepatitis b or hepatitis c * known additional malignancy that is progressing or requires active treatment * exceptions include basal cell carcinoma of the skin or squamous cell carcinoma of the skin that has undergone potentially curative therapy or in situ cervical cancer * known active central nervous system (cns) metastases and/or carcinomatous meningitis * subjects with previously treated brain metastases may participate provided they are stable, have no evidence of new or enlarging brain metastases, and are not using steroids for at least 7 days prior to trial treatment; this exception does not include carcinomatous meningitis which is excluded regardless of clinical stability * history or current evidence of any condition, therapy, or laboratory abnormality that might confound the results of the trial, interfere with the subject's participation for the full duration of the trial, or is not in the best interest of the subject to participate, in the opinion of the treating investigator * known psychiatric or substance abuse disorders that would interfere with cooperation with the requirements of the trial * pregnant or breastfeeding (female only)